hizzgdev / jsmind

a mind mapping library built by javascript
http://hizzgdev.github.io/jsmind/
Other
3.47k stars 867 forks source link

[Bugfix] update index after remove node #554

Closed hizzgdev closed 11 months ago

hizzgdev commented 11 months ago

An issue has been confirmed where the find_node_after and find_node_before works unexpected after nodes are removed, which is reported in https://github.com/hizzgdev/jsmind/issues/551.

The api find_node_after and find_node_before relies on the continuity of index field of nodes. But the index of nodes are not updated after nodes are removed.

This PR update the nodes' index, and resolve #551.