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

fix: Results seemingly not matching filter terms #380

Merged

Conversation

jonathanj
Copy link
Contributor

@jonathanj jonathanj commented Oct 3, 2022

In some cases filtering stories gives what appear to be the wrong results, however they are just being rendered with stale views as a result of an overly aggressive React.memo equality function.

What I did

  • Removed the React.memo equality function, there's no apparent performance impact (in a Storybook with ~100 stories) but the results are now correct

How to test

Screen.Recording.2022-10-03.at.21.35.58.mov

See the attached video for a reproduction, but the steps are more or less:

  • Select the second story in the list, it needs to be anything other than the first story
  • Search for "Date", expecting to find the "Date" stories
  • See the results appear to be incorrect
  • Select the "incorrect" result, and upon re-rendering the correct result is displayed

In some cases filtering stories gives what appear to be the wrong
results, however they are just being rendered with stale views as a
result of an overly aggressive `React.memo` equality function.
@dannyhw dannyhw merged commit bc0144c into storybookjs:next-6.0 Oct 4, 2022
@dannyhw
Copy link
Member

dannyhw commented Oct 4, 2022

@jonathanj thanks for your contribution 🙇

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

Successfully merging this pull request may close these issues.

2 participants