pingdotgg / uploadthing

File uploads for modern web devs
https://uploadthing.com
MIT License
4.21k stars 313 forks source link

[bug]: Multiple file uploads seem to trigger twice #965

Closed AlemTuzlak closed 1 month ago

AlemTuzlak commented 1 month ago

Provide environment information

System:
    OS: Windows 11 10.0.22631
    CPU: (24) x64 12th Gen Intel(R) Core(TM) i9-12900K
    Memory: 2.90 GB / 31.71 GB
  Binaries:
    Node: 20.16.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.21 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 10.6.0 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.8.0 - ~\AppData\Roaming\npm\pnpm.CMD
  Browsers:
    Chrome: 128.0.6613.138
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.22621.3527
  npmPackages:
    @uploadthing/react: ^7.0.2 => 7.0.2
    typescript: ^5.1.6 => 5.6.2
    uploadthing: ^7.0.2 => 7.0.2

Describe the bug

I followed your remix guide and added a multiple file dropzone https://github.com/user-attachments/assets/c6cdf72b-9763-41a7-be9a-20bee2032876

Link to reproduction

https://stackblitz.com/~/github.com/AlemTuzlak/uploadthing-remix

To reproduce

click on the text of the dropzone and try to upload multiple files add your key in the .env first though

Additional information

No response

๐Ÿ‘จโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Contributing

Code of Conduct

juliusmarminge commented 1 month ago

cc @markflorkowski event.stopPropagation() bug that you were fighting with in #886

markflorkowski commented 1 month ago

I hadn't seen it in the react package, but yeah this sounds like the same issue

AlemTuzlak commented 1 month ago

I added stopPropagation in the onDropCb and it seems to fix it the first time then it breaks the 2nd time you try