Prevent redundant keyup-listeners from being registered
See original GitHub issueI’m submitting a feature request
[ ] bug report
[ x ] feature request
[ ] support request
Current behavior Currently, instantiating any ngx-smart-modal register a keyup listener on the document, this causes exponential performance issues when a modal appears in a looped component.
Yes, I am aware the solution for this is to treat a modal like a singleton and ensure it is only declared once but that is not the point here.
Expected behavior
A listener should only be created when the corresponding config parameter requires it to be so.
e.g. a ngx-smart-modal where escapable
is false should not register a keyup
listener on the document.
Reproduction of the problem
-
Two modals appear in my list of 139 items, 7 appear outside of the list:
-
After removing both modals:
What is the motivation / use case for changing the behavior? Behavior that is configured to be disabled should be completely disabled.
Please tell us about your environment: macOS High Sierra 10.13.6
-
Smart Modal version: 6.0.4
-
Angular version: 5.2.11
-
Browser: all
-
Language: Typescript
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:5 (5 by maintainers)
Top GitHub Comments
@maximelafarie I’ve submitted a PR that fixes this issue: https://github.com/biig-io/ngx-smart-modal/pull/141
Could you have a look?
@maximelafarie Do you have a planned date for the next release?