-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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
Vue 3 is ignoring autocorrect="off" on input fields for iOS Chrome #5705
Comments
Fascinating. Can reproduce this on my iPad, switching the Vue version in the second codepen example. When using Vue 3, the keyboard is in composite mode and does an autocorrect. As we don't really do anything to the input in either version of Vue, there must be some weird little difference that makes WebKit not like it. maybe we add the attributes in a different order, maybe something else. |
Here's a pen with only the autocorrect attribute: https://codepen.io/ejg/pen/QWaVwvm It also happens in iOS Firefox, Edge, and Bluefy so it is definitely a base WebKit/Vue3 problem. |
Interesting. Personally I have zero ideas why that might happen. We literally don't do anything except set that attribute. |
I opened a bug report against WebKit maybe they can tell what is going on. |
I think this is a known problem with Webkit. Globally disabling iOS's keyboard autocorrection seems to be the only way to workaround the issue (I verified this on the simulator). |
The WebKit team closed the issue as not reproducible. Are you still seeing the issue? |
Yes. I can still reproduce on iOS 15.6/Chrome v103 using the vue reproduction link above, the codepen https://codepen.io/ejg/pen/QWaVwvm , and my website. |
I am experiencing this issue as well. Happenning with both webpack & vite. I've found it only happens when the attributes are declared in a .vue file. I've tried creating an input.html with contents:
and using it in a vue file with |
Also seeing this in Mobile Safari + Vue 3 (Nuxt 3), cannot reproduce in vanilla HTML/JS. I’ve resorted to setting the attribute again on mount:
|
Another data point--the input works correctly in Nuxt 3. |
thank you sir! it is working! <el-input
v-model="keywords"
autocapitalize="off"
autocorrect="off"
spellcheck="false"
/> |
Ok, so I did track and pinpoint the difference! Safari disagrees with Chrome and Firefox on this: "autocorrect" in document.createElement("input") This make shouldSetAsProp, return |
Link to WebKit bug report. That doesn't mean there's nothing to patch on Vue's side though as my report on WebKit's end is merely that it doesn't behave like Chrome and Firefox, which might absolutely be fine (I have no idea what the spec says, and if the specs even covers that). |
Firefox 136 (the latest release) now matches Safari behavior. I would anticipate Chrome moving to match soon, so it would be good to adjust Vue.js to expect this standards-compliant behavior. |
Thanks for the very insightful feedback @brentfulgham ! Since WebKit is leading the way (yay!), I tried to come up with a patch for Vue 😄 |
Any workaround in the mean time? I'm not sure I fully grasp what's happening. It seems like setting |
My workaround above, reset the input in
|
Right, thanks. I have a component wrapping input elements, can put that there. My other thought was to do this outside Vue, set |
Version
3.2.32
Reproduction link
sfc.vuejs.org/
Steps to reproduce
iPad - iOS 15.3.1 / Chrome - v100.0
In the input field, type a misspelled word with a space at the end, i.e. "ded ".
What is expected?
The word is not changed.
What is actually happening?
The word "ded" is autocorrected to "Dec".
Works correctly:
-- in iOS Safari
-- with Vue 2 - https://codepen.io/ejg/pen/popOJWo
-- Android v12
You will have to switch up the misspelled word. Chrome will remember the misspelling and not correct it when entered multiple times.
The text was updated successfully, but these errors were encountered: