You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Breaking change in webUtils.getPathForFile() (maybe due to new MacOS filesystem security?), File object on drag/drop event fails to resolve absolute path (still works with <input type="file">) #44600
I agree to follow the Code of Conduct that this project adheres to.
I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Electron Version
33.2.0
What operating system(s) are you using?
macOS
Operating System Version
Sequoia 15.1 (maybe older versions too)
What arch are you using?
x64
Last Known Working Electron version
No response
Expected Behavior
File object on drag/drop event should resolve to absolute path using webUtils.getPathForFile() (like <input type="file">)
(maybe due to new MacOS filesystem security?),
Actual Behavior
File object on drag/drop event resolves to empty absolute path when using webUtils.getPathForFile(). <input type="file"> still works fine, this seems to be a breaking change that applies to Electron versions [30...33] and probably due to some MacOS filesystem security (?) as this was working at some point before I upgraded to Sequoia 15.1
Testcase Gist URL
No response
Additional Information
I am trying to build a repro test case using Electron Fiddle...
Closing. I am unable to reproduce with ElectronFiddle, so the regression bug must have arisen from somewhere else. I will report back here when I figure this out! :)
To test, I added the following event handlers in ElectronFiddle's DOMContentLoaded template:
I had to move this to the context bridge and pass the file through which is now null. Are you still able to run/import webUtils from the renderer? I'm not able to import that without error.
Activity
danielweck commentedon Nov 8, 2024
Closing. I am unable to reproduce with ElectronFiddle, so the regression bug must have arisen from somewhere else. I will report back here when I figure this out! :)
To test, I added the following event handlers in ElectronFiddle's
DOMContentLoadedtemplate:danielweck commentedon Nov 8, 2024
We're using https://www.npmjs.com/package/react-dropzone
The fix was to pass the
getFilesFromEventprop to the<DropZone>component and to simply returnArray.from(ev.dataTransfer.files)... go figure :)https://github.com/react-dropzone/react-dropzone/blob/4ca683b9ed7a703661c5eacd0f6ef5e9b90e317f/typings/tests/plugin.tsx#L5-L8
steveoh commentedon Jan 23, 2025
I had to move this to the context bridge and pass the file through which is now null. Are you still able to run/import webUtils from the renderer? I'm not able to import that without error.
fix: drag-and-drop document upload in browser mode (#728) (#729)
Add drag-and-drop to add a folder