Thursday, 31 May 2018

How restore smooth scolling after format text in "ios contenteditable element"?

I want edit content inside "contenteditable element" on #ios. In that element is more text.

Steps

  1. I scroll smoothly to the selected text
  2. I touch into element and that open keyboard
  3. I touch and select multi lines of text and format it to bold
  4. 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

<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

  1. if keyboard is hidden and repeatedly opened by touch into any "contenteditable element"
  2. if I touch any other "clickable element"

Q does anyone have any idea how to keep "smooth scrolling"?



from How restore smooth scolling after format text in "ios contenteditable element"?

1 comment:

  1. https://www.wizweb.in

    Wizweb Technology is a leading software development company custom website design, software development, SMS Provider, Bulk sms, transactional sms, promotional sms, mobile app development, Hosting Solution, seo(search engine optimization) and Digital marketing etc.

    ReplyDelete