diff --git a/src/uix/eidos/components/words/words-block-handle.svelte b/src/uix/eidos/components/words/words-block-handle.svelte index 37b205fb3..1b0f2cf3e 100644 --- a/src/uix/eidos/components/words/words-block-handle.svelte +++ b/src/uix/eidos/components/words/words-block-handle.svelte @@ -154,8 +154,11 @@ } $effect(() => { - const content = document.querySelector('[data-words-content]'); - if (!content) return; + const found = document.querySelector('[data-words-content]'); + if (!found) return; + // Narrowed once at the top; TS doesn't carry the narrowing into + // the closure below, so we re-bind to a non-null `content`. + const content: HTMLElement = found; // Listen at the document level (not on `content`) so the cursor // crossing into the grip — which lives OUTSIDE the content box, diff --git a/src/uix/eidos/components/words/words-block-inserter.svelte b/src/uix/eidos/components/words/words-block-inserter.svelte index 806fa9528..c8a245ae3 100644 --- a/src/uix/eidos/components/words/words-block-inserter.svelte +++ b/src/uix/eidos/components/words/words-block-inserter.svelte @@ -114,8 +114,11 @@ } $effect(() => { - const content = document.querySelector('[data-words-content]'); - if (!content) return; + const found = document.querySelector('[data-words-content]'); + if (!found) return; + // Narrowed once at the top; TS doesn't carry the narrowing into + // the closures below, so we re-bind to a non-null `content`. + const content: HTMLElement = found; // Track movement on the document, not on `content`, so the "+" // button (which lives in the left margin OUTSIDE the content