Keep contextual filling help within modal form focus scopes
tests / ci (push) Waiting to run

This commit is contained in:
2026-11-17 10:08:07 +02:00
parent ded66878af
commit 953602fb85
4 changed files with 51 additions and 7 deletions
+21
View File
@@ -169,3 +169,24 @@ test('help mounts once across portal pages and the simulator publishes its curre
/<button[^>]*type="button"[^>]*data-form-help-open/s,
);
});
test('modal assistance remains inside the dialog focus scope and leaves form controls mounted', () => {
const component = readFileSync(
new URL(
'../../resources/js/components/form-field-help.tsx',
import.meta.url,
),
'utf8',
);
assert.match(component, /createPortal\(content, dialog\)/);
assert.doesNotMatch(
component,
/innerHTML|replaceChildren|appendChild|removeChild/,
);
const dom = readFileSync(
new URL('../../resources/js/lib/form-help-dom.ts', import.meta.url),
'utf8',
);
assert.match(dom, /dialog\[open\]/);
assert.doesNotMatch(dom, /cloneNode|\.value\b/);
});