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
[scoped-custom-element-registry]: Safari v16.4 focuses all custom elements #546
Comments
Something like this: static get ['formAssociated']() {
- return true;
+ return window.customElements._getDefinition(tagName)?.formAssociated ?? false
} |
im seeing this also. i wonder how we can tell safari not to allow host elements to be focusable when formAssociated is true? |
Can |
I think this is kind of a mixing of issues? in Safari, all focus delegation is broken because it breaks text selection. If you have focus delegation turned on, then the act of focusing that internal focusable element breaks the selection event somehow. You click into an element to start selecting, the focus happens, and selection stops. |
Description
Safari v16.4 supports
attachInternals
andformAssociated
features natively, and with the subject polyfill enabled all custom elements on the page are keyboard-focusable using Tab key, regardless of therole
or anything else.Here is the root of the problem:
polyfills/packages/scoped-custom-element-registry/src/scoped-custom-element-registry.js
Lines 218 to 220 in 90cb97f
Feels like Safari tries to focus any element with
static formAssociated = true
. If I change that tofalse
in the polyfill source code then the above wrong behavior becomes fixed.Is there a way to respect the original
formAssociated
value instead of enforcing it to betrue
?Example
Version
v0.0.9
Browsers affected
The text was updated successfully, but these errors were encountered: