Autodesk / orion-ui

UI Components that work seamlessly in multiple UI frameworks
https://goo.gl/shxHPB
Other
22 stars 6 forks source link

Can't insert child between siblings #222

Closed nfiniteset closed 7 years ago

nfiniteset commented 7 years ago

Inserting a child at the first position works correctly. Inserting a child at the last position works correctly. Attempting to insert a child between two others appends it to the end. It should append it between its siblings.

Cameron Westland

Here is the code that figures out where to insert the node.

It starts in createComponent and passes either an insertBefore or an appendChild to a HIGElement

In the case of insertBefore the HIGElement usually uses a HIGNodeList to keep track of the child element instances and it looks up the child at the insertBeforeIndex: (Example)

it then passes the instance to be inserted and then the beforeChild hig instance into the hig API’s add* method.

So the bug could be happening at the React createComponent level, the HIGElement#insertBefore level, the HIGNodeList level, or the hig.web level :smile: (edited)

camwest commented 7 years ago

@nfiniteset can you list the steps you took to reproduce this? What child component did you test it on?

recyclerobot commented 7 years ago

tested insertBefore in hig.web and confirmed it works there: https://github.com/adsk-hig/hig/blob/master/src/web/components/global-nav/tests/tests-global-nav.html#L168

nfiniteset commented 7 years ago

@camwest I have a failing spec for this here: #223

unitedempire commented 7 years ago

@recyclerobot can you verify this in Orion, this was before me, I have no idea what to test

recyclerobot commented 7 years ago

@unitedempire verified!