0

If popup/window property modal is set to true, Esc key doesn't close it. Is there a way to overcome such behavior?

A tiny sample of the window:

webix.ui({
  view:"popup",
  position:"center",
  height:400, width:400,
  //modal:true
}).show();  

http://webix.com/snippet/a7306fb0

  • 1
    I'm not familiar with Webix, but I'm guessing you can handle key events. Add an event listener on keydown and check to see if the key is Esc. If so, close the dialog. – Sumner Evans Nov 09 '16 at 17:27
  • Got it! I found there's a way to add the hotkeys with the needed methods. Thank you for pointing me in the right direction! – Nathan Leland Nov 10 '16 at 08:55

1 Answers1

0

According to the Webix Documentation I've defined my own hotkey to close the particular popup window:

webix.UIManager.addHotKey("esc", function(view) { 
   if ($$("modalPop").isVisible() && $$("modalPop").config.modal) $$("modalPop").hide()
}); 

You can see how it works: http://webix.com/snippet/03e10ab9