What happens
While the toolbar's URL input is focused, tap into a different node's text — for example from one button's text into another button's text. The caret visibly moves to the new button, but the toolbar still shows the previous button's data (e.g. its link URL). The selection debug panel confirms the model selection still points at the old node.
Why
While an app input has focus, canvas_focused is false and onselectionchange deliberately ignores selection changes (src/lib/Svedit.svelte) — so typing in inputs isn't misread as canvas selections.
On iOS Safari, tapping into text fires selectionchange before the canvas gets its focus event. That one event falls into the ignored window and no further selectionchange comes after focus settles. Result: the visible caret and the model selection are out of sync until the next tap or keystroke.
Suggested fix
When the canvas regains focus (handle_canvas_focus), read the current DOM selection once and map it to the model — the same thing onselectionchange does. That picks up any caret placed during the unfocused window.
Related: #342 (same family — toolbar inputs vs. canvas focus).
What happens
While the toolbar's URL input is focused, tap into a different node's text — for example from one button's text into another button's text. The caret visibly moves to the new button, but the toolbar still shows the previous button's data (e.g. its link URL). The selection debug panel confirms the model selection still points at the old node.
Why
While an app input has focus,
canvas_focusedis false andonselectionchangedeliberately ignores selection changes (src/lib/Svedit.svelte) — so typing in inputs isn't misread as canvas selections.On iOS Safari, tapping into text fires
selectionchangebefore the canvas gets itsfocusevent. That one event falls into the ignored window and no furtherselectionchangecomes after focus settles. Result: the visible caret and the model selection are out of sync until the next tap or keystroke.Suggested fix
When the canvas regains focus (
handle_canvas_focus), read the current DOM selection once and map it to the model — the same thingonselectionchangedoes. That picks up any caret placed during the unfocused window.Related: #342 (same family — toolbar inputs vs. canvas focus).