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

set leaf data when replacing leaf node #365

Merged
merged 1 commit into from
May 8, 2015

Conversation

tgvarik
Copy link
Contributor

@tgvarik tgvarik commented May 8, 2015

Leaf methods deleteText() and insertText() sometimes replace the leaf node with a new textNode, but neglect to call dom(textNode).data(Leaf.DATA_KEY, this), breaking line.getLeaf() and anything that depends on it.

This fix solves the problem, eliminating mysterious side-effects, e.g., not firing quill-selection-change events when the selection moves to some nodes.

Alternatively, the fix could be done inside dom.replace() instead.

@jhchen
Copy link
Member

jhchen commented May 8, 2015

Nice catch thanks!

@jhchen jhchen closed this May 8, 2015
@jhchen jhchen reopened this May 8, 2015
jhchen added a commit that referenced this pull request May 8, 2015
@jhchen jhchen merged commit a068c38 into slab:develop May 8, 2015
@tgvarik tgvarik deleted the fix/leaf-node-replacement-bug branch May 8, 2015 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants