-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Issue] Avoid binding magnifier events in duplicate on resize #30788
Comments
Hi @krishprakash. Thank you for working on this issue.
|
✅ Confirmed by @krishprakash Issue Available: @krishprakash, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself. |
Hi @engcom-Oscar. Thank you for working on this issue.
|
Hi @m2-assistant[bot]. Thank you for your report.
The fix will be available with the upcoming 2.4.3 release. |
This issue is automatically created based on existing pull request: #30695: Avoid binding magnifier events in duplicate on resize
Description
A browser resize event will trigger the magnifier to be re-initialised. This includes binding a fresh set of event listeners to the image so that the magnifier will show as expected (on click or hover). However, there is no mechanism to unbind the old event listeners, so each time the browser triggers a resize event these will stack.
This is made worse by the 'hover' event type triggering the 'mouseover' event immediately after adding a listener for the same. This means that each resize event will consume progressively more CPU, without any additional value.
Related Pull Requests
None
Fixed Issues
None
Manual testing scenarios
Before & after pictures from JavaScript profiler
Before:
After:
Questions or comments
None
Contribution checklist
The text was updated successfully, but these errors were encountered: