Skip to content

Minor issues with search #148

Open
Open
@cristianocca

Description

@cristianocca

Hello,

First issue with issue happens on the demo page as well (https://fritz-c.github.io/react-sortable-tree/)
It's a bit difficult to explain, but if you search something that has more than 1 result, then move to the second or any other result that's not the first one, and then search again with only ONE key press with something that will yield only 1 result, the node is correctly found but the tree is not scrolled.

Example on the demo page:

  • Search for "Dep", and hit enter until you are on the "Depth: 5" node, the first search result "Limit nesting with ..." should be barely visible now.
  • Move to the beginning of the text input and type "x", you should have "xDep" now, you can see only 1 result is found now, and the node correctly highlighted but the tree isn't scrolled until you actually type something else.

Something very similar happens when you collapse all nodes, trying to search or move the search node to the next value won't automatically scroll the first time, you need to "move" twice in order for it to work. For example, search for "Dep", move until the 4th result and then collapse all, finally hit enter on the search text and the tree will expand again but it won't scroll to the matched node until you actually hit enter twice, this is an issue if you only have 1 result, since you have to delete and write again.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions