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
Cannot reuse the callback passed in args to trigger action manually when with useArgs #12437
Comments
@tmeasday can you take a look? |
@y-nk do you have a reproduction uploaded somewhere? It sounds like the actions panel is refreshing, like it thinks you are changing story or something.. |
Here's a very minimal repro. You can spam click the checkbox to see the log in actions reset itself ; also the onChange action in argTypes shows in controls (but that's not so problematic since it's just display). |
Thanks for the reproduction @y-nk. So the issue is pretty simple, really. The actions addon clears itself whenever the story rerenders: This will mean actions will clear whenever you change a control value. The idea as you can see there is to clear on story change (there's even an option Would you like to send a PR with a fix? |
@tmeasday i'll try to work on this next week :) thanks a lot for your guidance ! |
Yowza!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.1.0-alpha.15 containing PR #12500 that references this issue. Upgrade today to try it out! You can find this prerelease on the Closing this issue. Please re-open if you think there's still more to do. |
Describe the bug
When using controls with useArgs to create a double binding, one can no longer use actions as well.
To Reproduce
Steps to reproduce the behavior:
Variations which product the same effect:
Expected behavior
The logging function
onChange
logs in the action panel as expected.What actually happen
The log appears for a brief instant and is cleared later on (if you spam the component, you can actually see it appear/disappear)
Notes
I'm sensing something related to the double binding with useArgs and the refresh of the panels, but have no further clue.
System:
The text was updated successfully, but these errors were encountered: