-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
[Feature]: Focus trigger on dialog close #921
Comments
Thanks for the issue and PR @enkot . However I have different solution in mind, similar to Headless UI.. perhaps internally we can track the previous focus target, and focus on it again when the dialog close. This way, user might need to not set additional prop, and have a more consistent behaviour. Imagine 2 buttons could trigger the same dialog. |
I agree, it will be a better solution. |
enkot
changed the title
[Feature]: Add
[Feature]: Focus trigger on dialog close
May 15, 2024
triggerElement
prop to the DialogRoot
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the feature
Currently, if a dialog is controlled by modelValue and does not use the DialogTrigger, focus cannot be handled properly (move focus back to the trigger after closing).
I suggest adding a
triggerElement
prop to theDialogRoot
so that the user can specify which trigger was used to open the dialog.Additional information
The text was updated successfully, but these errors were encountered: