You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my app I can open multiple modals. I want to close them with esc key.
So in every modal I'm adding combo with this.hotkeysService.add() which returns HotKey | Hotkey [].
But when in second modal I'm removing combo with this.hotkeysService.remove(hotKey) using hotKey instance created in second modal it removes all esc instances and esc key does not work with first modal.
The text was updated successfully, but these errors were encountered:
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 with
this.hotkeysService.add()
which returnsHotKey | Hotkey []
.But when in second modal I'm removing combo with
this.hotkeysService.remove(hotKey)
usinghotKey
instance created in second modal it removes allesc
instances andesc
key does not work with first modal.The text was updated successfully, but these errors were encountered: