-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix focus going to the DropZone after closing FileTrigger #5867
Conversation
Build successful! 🎉 |
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.
Could we instead stopPropagation of the click event? or cancel the click by preventingDefault on the pointer events (if memory serves)?
Or we could check the target vs currentTarget of the event?
Build successful! 🎉 |
Build successful! 🎉 |
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.
LGTM
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.
LGTM
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
## API Changes
unknown top level export { type: 'any' } |
Closes https://github.com/orgs/adobe/projects/19/views/4?pane=issue&itemId=31784583
The issue of the focus going to the wrong element is caused by the onClick function. Originally, this was added so that users could click on the dropzone to paste. However, an unintended side effect is that when a user would click on the FileTrigger, that would trigger the onClick function which would cause the focus to move to the visually hidden button. I've updated it so that the onClick function will only focus on the visually hidden button when the currentTarget and target are the same. See #4451 (comment) for more context
As for the second issue mentioned in the ticket, where the VO cursor would disappear after closing the FileTrigger, I think that's a separate, unrelated issue which is not DropZone specific. It seems that this also happens when an regular html input. You can test it here https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file on an iPhone and experience the same issue. So this PR doesn't fix that. Might be a VO bug?
✅ Pull Request Checklist:
📝 Test Instructions:
Test any of the stories with a filetrigger + dropzone in RAC
When you open a FileTrigger and close it, the focus should remain on the FileTrigger
Go to the
DropZone Example with Copyable Object
storyYou should be able to copy and paste with your keyboard and by clicking on the dropzone with your mouse and pasting it via command + v
🧢 Your Project: