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 #809 incorrect ViewNode prev and next siblings after appendChild/insertBefore #811

Merged

Conversation

delaneyb
Copy link
Contributor

@delaneyb delaneyb commented Mar 5, 2021

Fixes #809

@rigor789
Copy link
Member

rigor789 commented Mar 9, 2021

Nice find @delaneyb! Could you add a test similar to this

test('insertBefore sets the correct node relations', () => {
let node = new ViewNode()
let childNode = new ViewNode()
let refNode = new ViewNode()
node.childNodes = [refNode]
refNode.parentNode = node
node.insertBefore(childNode, refNode)
expect(node.childNodes.length).toBe(2)
expect(childNode.parentNode).toEqual(node)
expect(childNode.prevSibling).toBeFalsy()
expect(childNode.nextSibling).toEqual(refNode)
expect(refNode.prevSibling).toEqual(childNode)
expect(refNode.nextSibling).toBeFalsy()
})
to assert the childNode.prevSibling.nextSibling is set? I can do it a bit later as well, so no problem if you can't - will try to get to merging/releasing a patch sometime this week.

@rigor789
Copy link
Member

Awesome, thanks!

@rigor789 rigor789 merged commit 5156f20 into nativescript-vue:master Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

ViewNode insertBefore and appendChild issues
2 participants