-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
Inconsistent behavior of v-model sync during IME composition for <input type="search"> #5902
Comments
This behavior is intentional because syncing during composition often leads to awkward UX. What's the use case for this? |
example: https://jsfiddle.net/cloudyan/k9qbs068/ Expect type="search" to work like type="text" |
That's not a use case... what I am asking is why do you want the in-composition string to show up. |
我的英语水平太烂了,问题的描述如截图,我是认为 search 输入框作为 input,应该具备 text 一样的输入体验,我还没看懂关于此处的代码,应该是vue 处理了但显然处理方式不同,才导致这两种不同的显示结果 |
ok I get it now... |
* 'dev' of https://github.com/vuejs/vue: build: use cross-platform hook installation with shelljs build: move test config files into /test build: add script for generating release note build: add git commit message validation fix(v-model): use consistent behavior during IME composition for other text-like input types (fix vuejs#5902) simplify source with rest params fix slot resolved incorrect with abstract component (fix vuejs#5888) (vuejs#5895) test:improve reserved props test test:add bind object test fix:when using object syntax in v-bind, special attribute have no effect Be able to use string type index in array (vuejs#5889) Merge inject when extending a component (vuejs#5827) # Conflicts: # .gitignore # src/core/util/options.js
@yyx990803 |
Just stumbled on this issue myself. Handling composition events in an MVC way does not seem to be doable with current browser behavior. It is a breaker for a live search/live autocompletion functionality. As of now, the best way for me to handle this was to make a form with input element and re-read it on every compositionupdate event. This seems to be the only hack that works with UC browser. For some reason, UC does update the inputs inside forms on composition, yet it gives undefined as event data... It will be very very good is there will be a standard way set by upstream how to handle that, and proper explanation of bug's nature across browsers in docs. For me, I'm afraid, the cross browser solution will involve hardcoded hack for each major browser version. |
What problem does this feature solve?
http://vuejs.org/v2/guide/forms.html#Basic-Usage
For languages that require an IME (Chinese, Japanese, Korean etc.), you’ll notice that v-model doesn’t get updated during IME composition.
is OK, but type="search" is Not OK
What does the proposed API look like?
For languages that require an IME (Chinese, Japanese, Korean etc.), v-model(type="search") doesn’t get updated during IME composition.
The text was updated successfully, but these errors were encountered: