0

It's little hard to explain problem, so better to show example.

Test page

Code automatically replaced Latin alphabet to Armenian. In FF/Chrome/Opera it works great. In IE almost too. BUT if you select some text an try to write, typed character is replacing previous.

I tried

document.selection.empty();

but it doesn't help.

Do you know any method to reset/empty selection and leave cursor in same place in IE?

Thanks!

Narek
  • 3,813
  • 4
  • 42
  • 58

2 Answers2

3

I've written a couple of answers on Stack Overflow that address this:

Community
  • 1
  • 1
Tim Down
  • 318,141
  • 75
  • 454
  • 536
0

Looks like your IE-specific code indeed needs some extra code to set the cursor at the correct spot. Have a look at the MSDN documentation on TextRange, from what I can see you'd need the collapse method?

Also have a look at this SO question, I think that discusses exactly your problem.

Community
  • 1
  • 1
Jeroen
  • 60,696
  • 40
  • 206
  • 339