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

Update dom before initializing MutationObserver #52

Merged
merged 1 commit into from May 20, 2018

Conversation

Projects
None yet
2 participants
@ctjhoa
Copy link
Contributor

commented May 17, 2018

updateDom should be done before initializing MutationObserver because domChanged function can be immediatly triggered. This seems unneeded and can lead to bug.

In my case I use content-editable inside a modal and the value passed is reset to an empty string during init while content-editable innerText has the good value.

@ctjhoa

This comment has been minimized.

Copy link
Contributor Author

commented May 17, 2018

draft
Here is a record of the bug.
In the modal, I have display the value above the content-editable and you can see it flickering when modal shows up because it has been reset while innerText still got the value "aaaaaaaa"

@ctjhoa

This comment has been minimized.

Copy link
Contributor Author

commented May 17, 2018

draft 1
And if I change the content editable, the value is correctly updated

@st-h

This comment has been minimized.

Copy link
Owner

commented May 20, 2018

thank you for catching and fixing @ctjhoa
makes sense to invoke updateDom before attaching the MutationObserver

@st-h st-h merged commit 1d39335 into st-h:master May 20, 2018

2 checks passed

codeclimate All good!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@st-h

This comment has been minimized.

Copy link
Owner

commented May 20, 2018

released as 1.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.