[Webkit-unassigned] [Bug 261621] New: formAssociated=true causes custom element to become focusable
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Sep 15 14:23:56 PDT 2023
https://bugs.webkit.org/show_bug.cgi?id=261621
Bug ID: 261621
Summary: formAssociated=true causes custom element to become
focusable
Product: WebKit
Version: Safari Technology Preview
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: DOM
Assignee: webkit-unassigned at lists.webkit.org
Reporter: j.tu at salesforce.com
Created attachment 467691
--> https://bugs.webkit.org/attachment.cgi?id=467691&action=review
Repro
When enabling formAssociated on a custom element, it becomes focusable whereas when formAssociated is false it is not.
Chrome and Firefox both do not exhibit this behavior but it does occur in Safari Technology Preview Release 178 (Safari 17.0, WebKit 18617.1.6).
When setting formAssociated=false Safari behaves the same as Chrome and Firefox.
Attached is a repro showing that calling element.focus() with formAssociated=true causes focus to move to the element, which is demonstrated by document.activeElement below.
customElements.define(
'x-foo',
class Foo extends HTMLElement {
static formAssociated = true;
}
);
const foo = document.querySelector('x-foo');
foo.focus();
console.log(document.activeElement);
Note document.activeElement is <body> in Chrome and Firefox but <x-foo> in Safari.
Note that the spec does not imply any kind of focus behavior for formAssociated:
https://html.spec.whatwg.org/multipage/custom-elements.html#form-associated-custom-elements
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230915/f39b8f0e/attachment.htm>
More information about the webkit-unassigned
mailing list