Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
May 17, 2023

Conversation

powerfulyang
Copy link
Contributor

@powerfulyang powerfulyang commented May 16, 2023

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

Closes #1887.

@netlify
Copy link

netlify bot commented May 16, 2023

👷 Deploy request for docsearch pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit e4bce7e

Copy link
Member

@shortcuts shortcuts left a comment

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
Contributor Author

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

@powerfulyang
Copy link
Contributor Author

powerfulyang commented May 16, 2023

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

Copy link
Member

@francoischalifour francoischalifour left a comment

Choose a reason for hiding this comment

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

Thanks!

@powerfulyang
Copy link
Contributor Author

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

Co-authored-by: François Chalifour <francoischalifour@users.noreply.github.com>
@powerfulyang
Copy link
Contributor 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
Member

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

Copy link
Member

@shortcuts shortcuts left a comment

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!

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
3 participants