frontend-collective / frontend-collective/react-sortable-tree

searchMatches are never updated

Open
#497 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5k
Forks
914
PR merge metrics
No merged PRs in 30d

Description

I'm copy the example from [here](https://codesandbox.io/s/frontendcollectivereactsortabletree-sandbox-n48qb) and can't get the search focus/highlight working.

I debug the code and see that `getDerivedStateFromProps` is called a first time ( after pass the `searchQuery={text}` ) and it does `.search()` and return the `searchMatches`, but it is called again and in this second time it just returns the `instanceProps` and the prevState that came in this second time has the `searchMatches` empty.

I have the same dependencies like the sandbox, react/react-dom 16.9.0-alpha-0 and I also try with the previous one 16.8.6 but can't get it working.

I also literally copy the codesandbox.io code and put in in the main of my app, but it didn't work.

I can't reproduce or debug the state/error in https://codesandbox.io

If someone could give some idea or point me in some direction to understand this I will really appreciate it.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.