When you doubleclick there
, Chrome will display the entire text instead of just selecting that word. This issue occurs when you place the cursor to the left of H
and press CTRL + right arrow key
.
<div contentEditable="true">Hi<strong>1</strong>there<span>2</span>you</div>
This behavior should only select there
in the first case, and only Hi
in the second case.
Is it possible to correct this behavior using only CSS? If not, is there a solution with JavaScript? Note: It's important that no new symbols can be added to the editable text area.
JSFiddle: https://jsfiddle.net/7o6ykLt0/19/
Expected outcome after double-clicking there
:
https://i.sstatic.net/x2V7T.png
Actual outcome: