You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Wrong Selection when <input/> inside contenteditable is focused #1248
I compared the exact markup with an initially empty document selection. After focusing the input with a click, Tab, or input.focus(), Chromium, Firefox and WebKit all returned one collapsed range at (div, 0). On jsdom 20 with user-event 14.6.1 the range count was zero for all three paths.
A preceding text node makes a difference when choosing which boundary to emulate. With <div contenteditable><span>before</span><input></div>, Chromium and WebKit reported (div, 1), immediately before the input. Firefox reported (span.firstChild, 0). The engines agree on the original example. #1344 changes when the selection helper is called on programmatic focus, but the helper still returns early when the selection starts empty.
Activity
yucheng-du commentedon Dec 2, 2026
I compared the exact markup with an initially empty document selection. After focusing the input with a click, Tab, or
input.focus(), Chromium, Firefox and WebKit all returned one collapsed range at(div, 0). On jsdom 20 with user-event 14.6.1 the range count was zero for all three paths.A preceding text node makes a difference when choosing which boundary to emulate. With
<div contenteditable><span>before</span><input></div>, Chromium and WebKit reported(div, 1), immediately before the input. Firefox reported(span.firstChild, 0). The engines agree on the original example. #1344 changes when the selection helper is called on programmatic focus, but the helper still returns early when the selection starts empty.snowystinger commentedon Dec 2, 2026
I'm sorry, I have no idea what that comment is saying.
Are you saying this issue is still reproducing and that #1344 doesn't fix it?
Please make the intent of why you're commenting very obvious. What is the action you are suggesting be taken.