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

Prevent rerender when a button callback returns false. #7197

Merged
merged 4 commits into from
Jul 7, 2019
Merged

Prevent rerender when a button callback returns false. #7197

merged 4 commits into from
Jul 7, 2019

Conversation

danrha
Copy link
Contributor

@danrha danrha commented Jun 25, 2019

Issue: #6675

What I did

I added a validation after firing knob click callback to prevent the story from re-rendering.
I'm not really sure why the default behavior is needed, but it's breaking my use case and according to #6675 someone else's.

I updated knobs documentation accordingly.

@vercel
Copy link

vercel bot commented Jun 25, 2019

This pull request is automatically deployed with Now.
To access deployments, click Details below or on the icon next to each push.

Latest deployment for this branch: https://monorepo-git-fork-danrha-next.storybook.now.sh

@danrha danrha changed the title Prevent rerender when a button callback returns false. Prevent rerender when a button callback returns false. label:bug Jun 25, 2019
@danrha danrha changed the title Prevent rerender when a button callback returns false. label:bug Prevent rerender when a button callback returns false. Jun 25, 2019
@CodeByAlex CodeByAlex added the bug label Jun 25, 2019
Copy link
Member

@CodeByAlex CodeByAlex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Don’t see how this would have any negative impact. Thanks for contributing.

@shilman shilman added this to the 5.2.0 milestone Jun 26, 2019
Co-Authored-By: Wei-Wei Wu <hello@weiweiwu.me>
@danrha
Copy link
Contributor Author

danrha commented Jun 26, 2019

As this is something minor, is it possible to add this fix to the next 5.1.x release instead of waiting for 5.2? Thanks guys!

@shilman shilman added the patch:yes Bugfix & documentation PR that need to be picked to main branch label Jul 6, 2019
@ndelangen ndelangen modified the milestones: 5.2.0, 5.1.x Jul 7, 2019
@ndelangen ndelangen merged commit 29d9924 into storybookjs:next Jul 7, 2019
@shilman shilman added the patch:done Patch/release PRs already cherry-picked to main/release branch label Jul 31, 2019
shilman pushed a commit that referenced this pull request Jul 31, 2019
Prevent rerender when a button callback returns false.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants