mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 11:07:10 +00:00
document.activeElement names the host, not the node focused inside it, so a Compose-for-wasm app that mounts its tree in a shadow root reported focus on div#app forever. confirmFocus could never be satisfied and every InputText step aborted the run after three tries. selectAllScript already descends the boundary; the tree builder did not.
18 lines
646 B
HTML
18 lines
646 B
HTML
<!doctype html>
|
|
<html id="page">
|
|
<head id="page-head">
|
|
<meta id="page-charset" charset="utf-8" />
|
|
<title id="page-title">shadow focus</title>
|
|
</head>
|
|
<body id="page-body">
|
|
<!-- Shaped like Compose for Web: the app mounts its accessibility tree
|
|
inside a shadow root on this element, so document.activeElement answers
|
|
with the host for every field the user is typing into. -->
|
|
<div id="app"></div>
|
|
<script id="page-script">
|
|
const root = document.getElementById("app").attachShadow({ mode: "open" });
|
|
root.innerHTML = `<input id="shadow-field" type="text" />`;
|
|
</script>
|
|
</body>
|
|
</html>
|