jquery Plugin Autocomplete does not support multi-Chinese solutions

Source: Internet
Author: User
In web front-end development, when it comes to selection, AutoComplete is a fairly common plugin, but there are some bugs when it comes to Chinese.
When you enter a Chinese text each time, the plug-in works very well, when the input of multiple Chinese characters at a time, it can not produce filtering.


This problem is particularly noticeable on mobile phones. This problem exists even with the mobile version of Autocomplete.


Look at the source code, the reason is that filtering triggered events are judged according to Event.keycode. However, due to the particularity of Chinese input, especially on mobile phones, pinyin first, and then select Chinese characters,
This Chinese character, choose the action of Chinese character is not trigger keyboard event, more no event.keycode.
The problem arises from this.


Modify the source code, add to the input event monitoring, this event in the Chrome browser and mobile support excellent, he can listen to the contents of the input box changes in real-time, instead of waiting to lose focus, this is not the same as the onchange event.


Modify the following


It's probably a 156-line bound input event.


.
Bind ("Input", function () {onChange (0, True);})




After the modification, the problem is resolved.

jquery Plugin Autocomplete does not support multi-Chinese solutions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.