Skip to content
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

Fix removing resize event handler when multiple instances of AceDiff are created/disposed at the same time #113

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ianformanek
Copy link

When multiple instances are created and exist at the same time, the module removeEventHandlers would only contain the onResize handler for the last instance created, causing the removeEventListener in destroy() leaving behind the listeners from the earlier instances.

This then triggers console errors Cannot read property 'offsetHeight' of null, caused by the stray onResize handlers being called with the Ace instance DOM element no longer existing.

The fix simply keeps the removeEventHandlers with the AceEditor instance rather than on the shared module variable.

Fixes #64

empinator added a commit to empinator/ace-diff that referenced this pull request Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant