-
Bug
-
Resolution: Fixed
-
Normal
-
7.0.4
-
None
-
Security Level: Jimmy
-
None
-
None
Steps to Reproduce
- run the zul
<combobox width="150px" readonly="true" > <comboitem label="A1" value="A1" /> <comboitem label="B1" value="B1" /> <comboitem label="C1" value="C1" /> <comboitem label="1A" value="1A" /> <comboitem label="2A" value="2A" /> </combobox>
- click the drop-down arrow to open Comboitem list
- press 1 on numbpad
Actual Result
Combobox selects the item "A1".
Expected Result
Combobox should select the item "1A".
Debug Information
In Combobox widget, otherPressed_(), String.fromCharCode(keyCode), keyCode of numpad 1 is 97 which is converted to char 'a'.
According to the conclusion of http://unixpapa.com/js/key.html
On keydown and keyup events, the keycodes are not character codes, and this conversion will give wild results for many keys. There is no general portable way to convert keycodes to characters
We should not convert keydown event's keycode into a string. The keypress event's which is suggested.
http://www.w3.org/2002/09/tests/keys.html demonstrates keycode difference.