bbc / lrud

Left, Right, Up, Down. A spatial navigation library for devices with input via directional controls.
Apache License 2.0
94 stars 21 forks source link

Moving a node index under the same parent #107

Open pierpo opened 1 year ago

pierpo commented 1 year ago

Is your feature request related to a problem? Please describe.

We are trying to move a node in a list. But we can't call lrud.moveNode with the same parent and a different index, it just doesn't do anything.

Describe the solution you'd like

lrud.moveNode('my-node', 'same-parent-as-before', { index: newIndex })

Describe alternatives you've considered

For now, our idea of a workaround is moving the node to a virtual and unaccessible node at the root of our tree, then moving it back right away in the proper parent with the proper index. (we haven't tried it yet)

kukulaka commented 1 year ago

Hi @pierpo , sorry it's taken a little while for anyone to get back to you. LRUD has recently been moved to maintenance mode, so there a no plans to add enhancements.

BBC have recently made LRUD Spatial open source, and we recommend using this library going forward.