Open sspi opened 7 years ago
Note : this issue does not exist in Chrome Canary because the focus seems to always be moved to the range start point before the insertion.
In this specification, do we consider the insert point must always be at the first StaticRange InputEvent.getgetTargetRanges()[0]
start point ?
This is a good point. We should take it up in the next telco.
Example :
ab<em>cd</em>
If you select
bc
from left to right (focus node is in<em/>
) and typeX
, you will get :a<em>Xd</em>
If you select
bc
from right to left (focus node is before<em/>
) and typeX
, you will get :aX<em>d</em>
But the 2 events (type=beforeInput, inputType=insertText) are identical :
getTargetRanges()
will not help.The
Selection.focusNode
andSelection.focusOffset
are missing in the InputEvent in order to know where the insertion will take place.