bakerac4 / glimmer-native

77 stars 5 forks source link

Fix if block insert location #17

Closed bakerac4 closed 5 years ago

bakerac4 commented 5 years ago

I noticed that if you had an if block in your template as any element other than the last one, and it went from false to true the nodes inside would be added to the end instead of in the correct location.

The fix was to use the insertChild & removeChild from the NativeElementNode class - which correctly filters the child nodes https://github.com/bakerac4/glimmer-native/blob/master/src/dom/native/NativeElementNode.ts#L341