Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset highlight after items change #22

Open
lujiajing1126 opened this issue Oct 3, 2019 · 1 comment
Open

Reset highlight after items change #22

lujiajing1126 opened this issue Oct 3, 2019 · 1 comment

Comments

@lujiajing1126
Copy link
Contributor

According to the componentDidUpdate lifecycle method,

if (!isEqual(prevProps.items, this.props.items)) {
.....

The cursor will be reset everytime the items "change" which is not expected
in some cases.

For example, I just change the label properties which is actually displayed
on the screen, without changing value which is the key of the item and represents
real data. If so, the cursor is still reset.

So, I wonder if the condition could be changed. For example, just compare the values
of the items, or at least the length of the array.

Also, the control may be given to the developer by passing some prop as a function of shouldResetCursor?

@vadimdemedes
Copy link
Owner

So, I wonder if the condition could be changed. For example, just compare the values
of the items, or at least the length of the array.

I think that's an appropriate solution. Would you be able to contribute a fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants