jquery-simulate-ext icon indicating copy to clipboard operation
jquery-simulate-ext copied to clipboard

key-sequence: Problems with cursor position in WebKit browsers when simulating within an iframe

Open j-ulrich opened this issue 12 years ago • 0 comments

All of a sudden, the WebKit browsers (tested with Chrome) have problems with the cursor position when simulating a key-sequence on an input within in a child iframe.

E.g.: simulating the sequence "foo" and then simulating the sequence "bar" will produce "barfoo" because every simulation is executed at the beginning of the input. Even something like "{selectall}{rightarrow}bar" doesn't help. It still produces "barfoo".

Maybe there was some update on Webkit or Chrome which causes this.

For now, the workaround is to copy the value of the input, select all and then simulate the new sequence completely. For example:

var oldValue = $('#myInput').val(),
     suffix = "append-me";
$outer($('#myInput')).simulate('key-sequence', {sequence: '{selectall}'+oldValue+suffix});

j-ulrich avatar Mar 12 '13 16:03 j-ulrich