iOS: If the cursor position is moved in contenteditable div autocorrect popup stays.

Originator:Hans.Pinckaers
Number:rdar://13990460 Date Originated:25-May-2013 08:18 PM
Status:Open Resolved:
Product:Safari Product Version:5.0+
Classification:Serious bug Reproducible:Always
 
25-May-2013 08:18 PM Hans Pinckaers:
Summary:

When elements with words are added and cursor position is programmatically moved in a contenteditable div. The autocorrect popup stays on the old word and when typing space it applies the autocorrect on the just added word.

Steps to Reproduce:

Type in contenteditable div till the autocorrect popup comes up. Run this code:

            var selection = window.getSelection();
            if (selection.rangeCount == 0) return;
            var range = selection.getRangeAt(0);
            
            var span = document.createElement("span");
            span.innerHTML = "\n AND \n";
            range.insertNode(span);
            range.setStartAfter(span);
            selection.removeAllRanges();
            selection.addRange(range);	

Expected Results:

Autocorrect either accepts when moving the cursor or disappears.

Actual Results:

Autocorrect somehow remembers old position, applies on the wrong words

Regression:

Always occurs.

Notes:

I added a working project to test this. Also added screenshots to show what I mean.

25-May-2013 08:18 PM Hans Pinckaers:
'contenteditable.zip' was successfully uploaded

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!