Skip to content

feat: add setAutoFocus to dialog, deprecate setFocusTrap - #9799

Draft
vursen wants to merge 1 commit into
mainfrom
feat/dialog-auto-focus
Draft

feat: add setAutoFocus to dialog, deprecate setFocusTrap#9799
vursen wants to merge 1 commit into
mainfrom
feat/dialog-auto-focus

Conversation

@vursen

@vursen vursen commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

This PR adds a setAutoFocus method to Dialog that controls whether focus should automatically move into the dialog's overlay on open, and deprecates setFocusTrap in its favor. Disabling auto focus also disables the focus trap in modal dialogs, as the trap can't activate without focus moving inside.

Related to vaadin/web-components#12237

Fixes vaadin/web-components#11971

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@vursen
vursen marked this pull request as draft July 27, 2026 12:50
@sonarqubecloud

Copy link
Copy Markdown

* otherwise
* @since 25.3
*/
public boolean isAutoFocus() {

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.

question: should we rename to isAutofocus() to align with existing components?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Non-modal Dialog traps focus

2 participants