Skip to content

fix: support Chrome autofill when event.key is undefined#1888

Merged
shortcuts merged 2 commits into
algolia:mainfrom
powerfulyang:main
May 17, 2023
Merged

fix: support Chrome autofill when event.key is undefined#1888
shortcuts merged 2 commits into
algolia:mainfrom
powerfulyang:main

Conversation

@powerfulyang

@powerfulyang powerfulyang commented May 16, 2023

Copy link
Copy Markdown
image I always encounter errors with input autocomplete when using Next.js, and it's quite frustrating.

Closes #1887.

@netlify

netlify Bot commented May 16, 2023

Copy link
Copy Markdown

👷 Deploy request for docsearch pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit e4bce7e

@shortcuts shortcuts left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this for RSC or SSR purposes? looking at the types, it can't be undefined, but if this check solves it, it's not a huge deal to me

cc @francoischalifour wdyt?

@powerfulyang

Copy link
Copy Markdown
Author

chrome autocomplete in forms triggers 'keydown' but the event.key is undefined

@powerfulyang

powerfulyang commented May 16, 2023

Copy link
Copy Markdown
Author

Maybe KeyboardEvent type is incorrect.

https://www.w3.org/TR/uievents-key/#key-attr-values

or it's a chrome BUG.

paperjs/paper.js#1398
paperjs/paper.js@f1a0c0a

@powerfulyang powerfulyang requested a review from shortcuts May 16, 2023 07:53

@francoischalifour francoischalifour left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment thread packages/docsearch-react/src/useDocSearchKeyboardEvents.ts
@powerfulyang

Copy link
Copy Markdown
Author

scrnli_2023_5_16 20-27-03.webm
the auto-filling from chrome which registers as an undefined key

Comment thread packages/docsearch-react/src/useDocSearchKeyboardEvents.ts
Co-authored-by: François Chalifour <francoischalifour@users.noreply.github.com>
@powerfulyang

Copy link
Copy Markdown
Author

English is not my native language; please forgive me if I offend you in any way.

@francoischalifour francoischalifour changed the title fix: event.key is undefined #1887 fix: support Chrome autofill when event.key is undefined May 16, 2023
@francoischalifour

Copy link
Copy Markdown
Contributor

@powerfulyang Nope, nothing to worry about 🙂 Thanks for your contribution!

@shortcuts shortcuts left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the contribution!

@filipw01

Copy link
Copy Markdown

For anyone looking for the actual chrome issue https://issuetracker.google.com/issues/41425904

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chrome autocomplete in forms triggers 'keydown' but the event.key is undefined

4 participants