-
Bug
-
Resolution: Fixed
-
Normal
-
8.6.2
-
Security Level: Jimmy
-
None
-
None
Steps to Reproduce
<datebox open="true" format="yyyy MM dd"/>
focus the datebox start typing a date (don't close the popup)
e.g. try typing: 2019[SPACE]01[SPACE]01
Current Result
after pressing space the date is completed with the current date, then the SPACE is appended to the end
Expected Result
append a SPACE the value typed
Debug Info
SPACE triggers a selection in the calendar popup like clicking a date which doesn't make sense when typing a date manually
ARROW keys are arguable: I quite like the fact that starting to use ARROW keys moves the focus down to the calendar popup after that direct typing is no longer enabled so that SPACE can continue to behave normally
Root Cause
Datebox._doKeyDown has special handling for ENTER/ESC but misses to avoid sending the SPACE character down to the popup, while still typing
Workaround
don't handle SPACE (32) as a special key while typing in the datebox
zk.afterLoad('zul.db', function() { var xDatebox = {}; zk.override(zul.db.Datebox.prototype, xDatebox, { _doKeyDown : function(evt) { if (evt.keyCode !== 32) { xDatebox._doKeyDown.apply(this, arguments); } } });//zk.override });//zk.afterLoad