Similarly to the feedback listed in https://feedback.telerik.com/kendo-jquery-ui/1560733-multiselect-keyboard-events-bubble-although-already-handled#:~:text=The%20approach%20described%20in%20order%20to%20prevent%2Foverwrite%20the,well%3A%20kendo.ui.MultiSelect.fn._keydown%20%3D%20function%28e%29%20%7B%20e.preventDefault%20%28%29%20%7D%3B
I am exploring using a multiselect box within a window. If I choose to not allow the multiselect to autoClose, hitting the escape key will close the multiselect, but the event will continue to bubble up and will close the window. Ideally, the multiselect should close its panel, but the window it is embedded on should not.
One solution to this problem is to add a handler for the close event on the window, however there is currently no way to determine if the close event is being triggered by clicking the close button on the window, or from an escape character (e.userTriggered does not go far enough to differentiate). I would like the user to be able to click the close button manually to close the dialog, but not necessarily use the keyboard Escape key. See: https://docs.telerik.com/kendo-ui/api/javascript/ui/window/events/close
The following solution as mentioned in the feedback link above, can be used to stop the propagation of the Escape key globally, but this then breaks all other keyboard actions (which is bad from a usability standpoint). Is there any way to add this functionality? From looking at the source (which we have as part of our subscription), simply adding e.stopPropagation() when responding to the ESC key in the _keydown function of kendo.multiselect.js would be enough to fix this issue.
kendo.ui.MultiSelect.fn._keydown = function (e) {
if (e.which === 27) {
e.stopPropagation();
}
}
Thanks.