shima tetuo
2006-Jul-05 06:15 UTC
Ajax.Autocompleter onkeypress problem when typing in Japanese
Hi, all. --------------- environments --------------- prototype.js Version: ''1.5.0_rc0'', scriptaculous.js Version: ''1.6.1'', windows 2000 When typing Japanese(or other multibyte languages) in a textbox, like the images below, it holds the inputs until "enter(return key)" is pressed. This is all controlled by "IME"(well, on windows) http://www.inter-locale.com/whitepaper/learn/learn_to_type_files/learn_to_type010.jpg http://www.inter-locale.com/whitepaper/learn/learn_to_type_files/learn_to_type010a.jpg http://www.inter-locale.com/whitepaper/learn/learn_to_type_files/learn_to_type010c.jpg http://www.inter-locale.com/whitepaper/learn/learn_to_type_files/learn_to_type010b.jpg ref. http://www.inter-locale.com/whitepaper/learn/learn_to_type.html When just typing alphabets and numbers, the event Ajax.Autocompleter can be hooked by "keypress", as it is now, because as you type is as it is inputted into the textbox. However, when typing Japanese words, words are not inputted into the textbox until the user press the enter(return key). This results the Ajax.Autocompleter to fail fetching the right results. ex. When start typing in Japanese, "keypress" occurs, but any words are not actually reflected in the textbox, and before user presses the enter (return key), Ajax.Autocompleter''s frequency time comes, and it sends a request with "empty value". controls.js @ line 78 Event.observe(this.element, "keypress", this.onKeyPress.bindAsEventListener(this)); If this event that Ajax.Autocompleter takes is replaced with "keyup" this problem won''t happen since "keyup" occurs when the enter(return key) is pressed when typing in Japanese. (even if users don''t type in Japanese, "keyup" still occurs and this change shouldn''t be a problem) Please check this screen cast, you will have more sense of what I mean. http://mlmlml.yaekumo.com/Ajax.Autocompleter/IME.htm ref. http://mlmlml.yaekumo.com/Ajax.Autocompleter/events.html tetuo mlmlml-f045QctiOnTjratgjr5x9nf5DAMn2ifp@public.gmane.org