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
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Performance issue
[ ] Feature request
[x] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:
Current behavior
Pressing the hotkey removed by removeShortcuts() may cause TypeError.
Assume that a user presses the hotkey which is already removed by removeShortcuts().
Reading the original issue & PR, I could not find whether the current behavior is by design or not.
If it's not by design, removeShortcuts() should dispose EventManager's eventListener.
If it's by design, adding the explanation of this behavior to the docs might be helpful.
Minimal reproduction of the problem with instructions
unsubscribe.component for example 1, and no-unsubscribe.component is for example 2.
What is the motivation / use case for changing the behavior?
removeShortcuts() might not work properly.
Environment
Angular CLI: 12.1.1
Browser:
- [x] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
The text was updated successfully, but these errors were encountered:
I'm submitting a...
Current behavior
Pressing the hotkey removed by removeShortcuts() may cause TypeError.
Assume that a user presses the hotkey which is already removed by removeShortcuts().
example 1:
This works fine. Pressing
shift.a
does nothing as expected.example 2:
In this case, pressing
shift.a
causesERROR TypeError: Cannot read property 'allowIn' of undefined
on
hotkeys/projects/ngneat/hotkeys/src/lib/hotkeys.service.ts
Line 85 in f3c8c6e
It seems that unsubscribing addShortcut()'s subscription disposes Angular EventManager's eventListener, but removeShortcuts() does not.
Expected behavior
#6
#9
Reading the original issue & PR, I could not find whether the current behavior is by design or not.
If it's not by design, removeShortcuts() should dispose EventManager's eventListener.
If it's by design, adding the explanation of this behavior to the docs might be helpful.
Minimal reproduction of the problem with instructions
/~https://github.com/ebichan38/hotkeys-unsubscribe
unsubscribe.component for example 1, and no-unsubscribe.component is for example 2.
What is the motivation / use case for changing the behavior?
removeShortcuts() might not work properly.
Environment
The text was updated successfully, but these errors were encountered: