fix form selection when element is detached (#1806) (#1881)

Co-authored-by: cyantree <cyantree@users.noreply.github.com>
pull/1924/head
cyantree 2024-03-06 16:34:59 +01:00 zatwierdzone przez GitHub
rodzic 3bc8495874
commit 2a4b3ee2e9
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 2 dodań i 3 usunięć

Wyświetl plik

@ -72,9 +72,8 @@ export class FormControlController implements ReactiveController {
const formId = input.form;
if (formId) {
const root = input.getRootNode() as Document | ShadowRoot;
const form = root.getElementById(formId);
const root = input.getRootNode() as Document | ShadowRoot | HTMLElement;
const form = root.querySelector(`#${formId}`);
if (form) {
return form as HTMLFormElement;