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

Storybook Interactions File upload causes dialog to open #17882

Open
ice1080 opened this issue Apr 5, 2022 · 1 comment
Open

Storybook Interactions File upload causes dialog to open #17882

ice1080 opened this issue Apr 5, 2022 · 1 comment

Comments

@ice1080
Copy link

ice1080 commented Apr 5, 2022

Describe the bug
When using storybook and @storybook/addon-interactions, a userEvent.upload(<element>, file) causes the file upload dialog to appear even though the file was already uploaded by the interaction.

To Reproduce
Reproduction repository: https://github.com/ice1080/storybook-upload-issue-repro
(see note below for why I was unable to publish the repo)

System

$ npx sb@next info

Environment Info:

  System:
    OS: Linux 5.16 Pop!_OS 21.10
    CPU: (20) x64 Intel(R) Core(TM) i9-10850K CPU @ 3.60GHz
  Binaries:
    Node: 12.18.2 - ~/.nvm/versions/node/v12.18.2/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 8.5.1 - ~/.nvm/versions/node/v12.18.2/bin/npm
  Browsers:
    Chrome: 99.0.4844.84
    Firefox: 98.0.2
  npmPackages:
    @storybook/addon-actions: ^6.4.9 => 6.4.9 
    @storybook/addon-essentials: ^6.4.9 => 6.4.9 
    @storybook/addon-interactions: ^6.4.19 => 6.4.19 
    @storybook/addon-links: ^6.4.9 => 6.4.9 
    @storybook/builder-webpack5: ^6.4.9 => 6.4.9 
    @storybook/manager-webpack5: ^6.4.9 => 6.4.9 
    @storybook/react: ^6.4.9 => 6.4.9 
    @storybook/testing-library: ^0.0.9 => 0.0.9 

Additional context
Steps to see this issue:
Run storybook in the repro repo above.
Click on the "Test Input" story, wait two seconds, the open file dialog is opened, even though the file in the story was uploaded to the input successfully. This causes the rest of the interactions in the story to be hidden.
Note that this only happens when the user manually clicks on the story from a different story. If the component or story is changed and storybook refreshes that story, this behavior does not occur.

Assumed expected behavior:
File upload successfully sets the file on the input without opening the manual select dialog.

Side note:
I tried to publish the repo using the steps described in the how-to-reproduce, following it exactly, and ran into this error when running the npx chromatic command:

sh: 1: chroma: not found

and the apt version of chroma is a game that is unrelated to the command trying to be run.

@rolandtoth
Copy link

Same here. Any new on this?

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

No branches or pull requests

4 participants