Skip to content

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

@j-ulrich

Description

@j-ulrich

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});

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions