WKWebView scrolls when contenteditable element with touchend listener is tapped

Originator:craig
Number:rdar://20871091 Date Originated:2015-05-08 12:00 AM
Status:Open Resolved:
Product:iOS SDK Product Version:8.3
Classification:Serious Bug Reproducible:Always
 
Summary:
I have a WKWebView containing a document with a contenteditable body element. If in JavaScript I attach a touchend listener to the element, then enter enough text to cause text to flow onto another line (there may be other reproduction steps but this consistently triggers it for me), upon tapping on the view (e.g. with the intention of performing text selection or to reposition the caret) the body loses focus and the scrollview scrolls so the location of my tap is centred in the view.

This may be related to the following WebKit issue, which sounds similar albeit in a different context: https://bugs.webkit.org/show_bug.cgi?id=136115

Steps to Reproduce:
1. Tap the body of the document so editing begins
2. Enter enough text so the caret moves onto another line
3. Tap and hold above the caret, say in the preceding paragraph

Expected Results:
The magnifying glass should appear, enabling caret positioning

Actual Results:
The view scrolls so the location of the tap is centred

Version:
iOS 8.3

Notes:
https://github.com/Bipsync/ios-wkwebview-touchend

Configuration:
iPhone 5 / iOS Simulator

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!