Skip to content
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

[sparkle] Take focus in modal over close button #8772

Merged
merged 3 commits into from
Nov 21, 2024
Merged

[sparkle] Take focus in modal over close button #8772

merged 3 commits into from
Nov 21, 2024

Conversation

tdraier
Copy link
Contributor

@tdraier tdraier commented Nov 20, 2024

fixes: https://github.com/dust-tt/tasks/issues/1679

Description

Glitch appears when the close button takes focus on modal open. Give the focus to modal content instead (and remove the focus outline)

Risk

Deploy Plan

@tdraier tdraier requested a review from JulesBelveze November 20, 2024 10:18
Copy link
Contributor

@JulesBelveze JulesBelveze left a comment

Choose a reason for hiding this comment

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

Isn't this gonna conflict with the other focus we have (idk if we do have some actually) ?

@tdraier
Copy link
Contributor Author

tdraier commented Nov 20, 2024

Isn't this gonna conflict with the other focus we have (idk if we do have some actually) ?

which one ? (in my cas the close button was taking the focus)

@JulesBelveze
Copy link
Contributor

I mean, let's say I want to add focus on an Input inside a modal, I guess they'll be conflicting right?

@tdraier
Copy link
Contributor Author

tdraier commented Nov 20, 2024

I mean, let's say I want to add focus on an Input inside a modal, I guess they'll be conflicting right?

If you have an explicit focus it should take over the simple tabIndex=1. I can also use tabIndex=32767 , which will come before the button but after any other positive tabIndex value. Do you have an example ?

Copy link
Contributor

@JulesBelveze JulesBelveze left a comment

Choose a reason for hiding this comment

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

Seen IRL, LGTM -> planning on moving to radix sheet soon anyways

@tdraier tdraier merged commit 0eea1c4 into main Nov 21, 2024
6 checks passed
@tdraier tdraier deleted the modal-glitch branch November 21, 2024 15:59
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.

2 participants