-
Notifications
You must be signed in to change notification settings - Fork 16
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 drag when rename #2067
Prevent drag when rename #2067
Conversation
…ChainSafe/ui-monorepo into fix/tbaut-save-on-blur-edit-loader-2050
…leSystemItem/FileSystemGridItem.tsx Co-authored-by: Tanmoy Basak Anjan <[email protected]>
…ChainSafe/ui-monorepo into fix/prevent-drag-when-rename-2051
Your Render PR Server URL is https://storage-ui-stage-pr-2067.onrender.com. Follow its progress at https://dashboard.render.com/static/srv-c93blqn9re0s81s6irng. |
Your Render PR Server URL is https://chainsafe-components-stage-pr-2067.onrender.com. Follow its progress at https://dashboard.render.com/static/srv-c93blrn9re0s81s6is50. |
Your Render PR Server URL is https://files-ui-stage-pr-2067.onrender.com. Follow its progress at https://dashboard.render.com/static/srv-c93blsv9re0s81s6iseg. |
…leSystemItem/FileSystemGridItem.tsx
…ChainSafe/ui-monorepo into fix/prevent-drag-when-rename-2051
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately this doesn't solve the problem I mentioned in the issue. I still can't select some text in the rename input with the mouse (that's only on FF), and the input isn't focuses automatically as it should either.
Idk the drag logic well, but I don't really understand why we'd need to make this draggable, and then cancel anything that's happening, this looks hacky to me (maybe it's not though?)
Could we add this for storage as well
Interesting, I found this discussion here, says its a known issue with FF, there are also some interesting hacks - looking into them Also the draggable implementation is something I found in the React DnD repo discussions. Looking into coming up with a more solid approach to this. Also the storage side of DnD is old code, I'm going to create a separate issue to recheck the DnD in storage overall. |
This change is a great UX improvement, the only thing I found was the FF issue Thibaut already mentioned. I will check it out again when FF improvements are ready. |
packages/files-ui/src/Components/Modules/FileBrowsers/views/FileSystemItem/FileSystemItem.tsx
Outdated
Show resolved
Hide resolved
…leSystemItem/FileSystemItem.tsx
Finally found nice hacks to keep FF happy as well as get the autofocus.
Created #2071 to update storage side of DnD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latest changes look great, working well in firefox now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, I added the hack for shared folder renaming as well to get the focus. I don't really know what's going on here with the text input, like why it needs the hack, maybe the fact that it appears only after the page load..
Also I saw that the trick isn't implemented on Storage but I guess it should be part of #2071
closes #2051
Preventing drag events from the textinput works better than dynamically removing refs.