Open piernik opened 5 years ago
I think the easiest way to solve this is to just add the one hotkey for esc that will call a method in a service you've created and this service keeps track of any open modals and close them when it's pressed. That way you don't need to keep adding/removing the hotkey in this module.
I'll try to keep this in mind for if I try to rebuild how the remove-method works, but I doubt that will happen anytime soon, so I suggest going with the workaround mentioned above instead.
In my app I can open multiple modals. I want to close them with
esc
key. So in every modal I'm adding combo withthis.hotkeysService.add()
which returnsHotKey | Hotkey []
. But when in second modal I'm removing combo withthis.hotkeysService.remove(hotKey)
usinghotKey
instance created in second modal it removes allesc
instances andesc
key does not work with first modal.