Skip to content

fix: prevent DropZone focus on hidden file input click#10173

Open
pradeep-ramola wants to merge 1 commit into
adobe:mainfrom
pradeep-ramola:pradeep-ramola/dropzone-filetrigger-focus-scroll
Open

fix: prevent DropZone focus on hidden file input click#10173
pradeep-ramola wants to merge 1 commit into
adobe:mainfrom
pradeep-ramola:pradeep-ramola/dropzone-filetrigger-focus-scroll

Conversation

@pradeep-ramola

Copy link
Copy Markdown

Fixes #10092

When a FileTrigger is used inside a DropZone, its hidden file input can dispatch a programmatic click that bubbles to the DropZone. Since the hidden input is not focusable, DropZone treats the event like a click on non-focusable dropzone content and focuses its visually hidden drop button, which can scroll positioned overflow ancestors.

This ignores hidden file input clicks in DropZone's fallback focus handling and adds a regression test that verifies the visible FileTrigger button keeps focus.

@pradeep-ramola pradeep-ramola force-pushed the pradeep-ramola/dropzone-filetrigger-focus-scroll branch from b7c329e to c37dbff Compare June 9, 2026 03:52

@snowystinger snowystinger left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the interest, but this is not the right fix. Please see #10092 (comment)

@pradeep-ramola pradeep-ramola force-pushed the pradeep-ramola/dropzone-filetrigger-focus-scroll branch from c37dbff to c14eee0 Compare June 9, 2026 05:21
@pradeep-ramola

Copy link
Copy Markdown
Author

Thanks for the pointer. I removed the FileTrigger/input-click guard and revised this to preserve the existing focus fallback. The PR now proposes an opt-in dropButtonStyle API for the internal visually hidden drop button wrapper, so consumers can use positioning such as position: fixed in scroll-container cases.

Happy to adjust the API shape or naming if you’d prefer a different direction.

@snowystinger snowystinger dismissed their stale review June 9, 2026 05:43

PR updated, will re-review later. Removing my block though.

@snowystinger snowystinger left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified that it works by editing the node_modules in the example repo to have the same code change.

Thanks!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FileTrigger inside DropZone causes scrollable ancestor to jump on click

2 participants