Skip to content

Conversation

@Magnus93
Copy link
Contributor

This PR removes all preventDefault from beforeinput events.
The preventDefault made it seem to Chrome that the user never typed and so it would autofill the value again when it changed.

cant-remove-password-in-chrome.mp4

Unfortunately the autofill is still not perfect since if you keep switching what values are autofill it will sometimes not autofill the correct values you choose (this bug is not new). Makes me think that maybe logins should just use regular input and form elements, and just listen to the submit for formdata instead. But this PR is at least an improvement.

@Magnus93 Magnus93 self-assigned this Dec 30, 2025
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 30, 2025

Deploying smoothly with  Cloudflare Pages  Cloudflare Pages

Latest commit: f20b335
Status: ✅  Deploy successful!
Preview URL: https://42233a8f.smoothly.pages.dev
Branch Preview URL: https://remove-prevent-default-from.smoothly.pages.dev

View logs

@Magnus93
Copy link
Contributor Author

This PR seems to break the autofill on load for some reason.
Chrome is one infuriating browser!

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.

2 participants