I want edit content inside "contenteditable element" on #ios. In that element is more text.
Steps
- I scroll smoothly to the selected text
- I touch into element and that open keyboard
- I touch and select multi lines of text and format it to bold
- I want scroll content now but it's not smoothly anymore
Here is playable code:
https://console.webcloud.io/profile/bruno.onlyme@gmail.com/_playwithcode/contenteditable-scroll-after-format/index.html
Video preview here.
<html>
<head>
<meta name="viewport" content="width=device-width,minimum-scale=1,maximum-scale=1,user-scalable=no">
<style>
body {
font-size: 24px;
}
</style>
</head>
<body>
<button>button</button> | <a onclick="console.log();">anchor</a><br>
<br>
<div contenteditable>
What is Lorem Ipsum?
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
Why do we use it?
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
</div>
<br>
<button>button</button> | <a onclick="console.log();">anchor</a>
</body>
</html>
After a huge investigation I figure out that this issue is in S CH FF, Opera somehow solve it but not work another things correctly. This issue is in every known editor #ckeditor5 #medium #alloyeditor too.
"Smooth scroll" is restored only on 2conditions
- if keyboard is hidden and repeatedly opened by touch into any "contenteditable element"
- if I touch any other "clickable element"
Tested in
- NOK iphoneX ios11.4
- NOK iphone6 ios11.4
- NOK iphone6 ios11.3.1
- NOK iphone5s ios11.4
- OK iphone5s ios11.3.1
- OK iphoneSE ios11.4
- OK iphoneSE ios9.3.2
INFO @31.05.2018 - apple bug reported but no response from them
INFO @15.06.2018 - new trigger event - select more rows https://bugs.webkit.org/show_bug.cgi?id=186333#c2
INFO @25.06.2018 - I create a new test where #contenteditable is inside #iframe and "smooth scroll" works only if I after open #keyboard scroll up down, then I can format, still after that smooth scroll - after close keyboard and reopen it didn't work - I think it's all about that "virtual space" what "keyboard create" and it's need some kind "refresh dimensions".
Q does anyone have any idea how to keep "smooth scrolling"?