-
Notifications
You must be signed in to change notification settings - Fork 26
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
[Focus]: Set delegatesFocus on all components #559
Conversation
@petemill @AlanBreck any idea of the wider implications of this? |
952c2a1
to
5dc55b4
Compare
👋 Thanks for Submitting! This PR is available for preview at the link below. ✅ PR tip preview: https://559.pr.nala.bravesoftware.com/ Variables Diff--- ./tokens/css/variables.old.css 2024-02-20 22:26:26.141932107 +0000
+++ ./tokens/css/variables.css 2024-02-20 22:25:59.294033083 +0000
@@ -1,6 +1,6 @@
/**
* Do not edit directly
- * Generated on Tue Feb 20 2024 20:43:18 GMT+0000 (Coordinated Universal Time)
+ * Generated on Tue Feb 20 2024 22:25:59 GMT+0000 (Coordinated Universal Time)
*/
:root {
|
This seems like a caveat worth consideration. What are the negatives of not doing this? |
The negatives of not doing this are that for elements like the Button, Input, Dropdown ect calling However, it sounds like we might not want this for non |
FWIW, @nullhook PR brave/brave-core#22220 depends on this. Maybe we need to come up with a way for components to opt in/out of this behavior? |
Going to not merge this for another couple of days, for the brave-core release |
This delegates the focus to the first focusable element (or the element with
autofocus
) inside the shadowDOM when.focus()
is called on the element.I don't know if we want this for every component, but it does seem like a sensible default.
https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/delegatesFocus