Jemt / Fit.UI

Fit.UI is a JavaScript based UI framework built on Object Oriented principles
http://fitui.org
GNU Lesser General Public License v3.0
19 stars 7 forks source link

DatePicker suppresses certain key strokes (e.g. ENTER, ESC) #115

Open FlowIT-JIT opened 3 years ago

FlowIT-JIT commented 3 years ago

The DatePicker control, which is based on jQuery UI's DatePicker, unfortunately implements some bad practices when it comes to event handling.

It all starts in _doKeyDown: https://github.com/Jemt/Fit.UI/blob/master/Resources/JqueryUI-1.11.4.custom/jquery-ui.js#L879

The function will suppress events on line 971 unless handled has been set true, or if a case returns false, like on line 908.

This makes it impossible to implement key listeners further up the hierarchy in the bubble phase.

Important: Make sure to document any changes to Resources/JqueryUI-1.11.4.custom/jquery-ui.js in Resources/JqueryUI-1.11.4.custom/README-FitUiCustomJqueryUiBuild.txt !

And do be aware that changing the implementation of keyboard events might cause breaking changes - for instance in a <form> element which might submit when ENTER is pressed, if we decide to no longer suppress key strokes events.