<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>191185</bug_id>
          
          <creation_ts>2018-11-02 03:22:07 -0700</creation_ts>
          <short_desc>Viewport is not scrolled to the selection on typing in contentEditable or textarea</short_desc>
          <delta_ts>2018-11-05 01:47:49 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>HTML Editing</component>
          <version>Safari 12</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>iOS 12</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Piotrek Koszuliński (Reinmar)">pkoszulinski</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>alberto</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wenson_hsieh</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1474437</commentid>
    <comment_count>0</comment_count>
    <who name="Piotrek Koszuliński (Reinmar)">pkoszulinski</who>
    <bug_when>2018-11-02 03:22:07 -0700</bug_when>
    <thetext>I think this is a recent regression because this started to be reported to us very recently (e.g. in https://github.com/ckeditor/ckeditor5/issues/1321). 

To reproduce (on iOS):

1. Open https://jsfiddle.net/hzkfdrgw/
2. Place the selection in the textarea. Press the enter a couple of times.
3. Scroll the viewport so the caret goes off screen.
4. Type something.

Expected behaviour: the viewport is scrolled to show the selection.

Actual behaviour: the viewport is not scrolled.

Screencast: http://sendvid.com/qzpnxe3h

Severity: This is a quite serious issue due the fact that is super hard to create a workaround for it that would work in mobile Safari due to Safari&apos;s broken viewport when the software keyboard is visible. My tests (https://github.com/ckeditor/ckeditor5/issues/1321#issuecomment-435330662) show that on all other browsers we can reliably show the selection by playing with `window.scrollTop`. But that algorithm doesn&apos;t work in mobile Safari. I&apos;ll be filling a separate bug report about the viewport.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1474493</commentid>
    <comment_count>1</comment_count>
    <who name="Wenson Hsieh">wenson_hsieh</who>
    <bug_when>2018-11-02 08:24:07 -0700</bug_when>
    <thetext>&lt;rdar://problem/28300343&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1474494</commentid>
    <comment_count>2</comment_count>
    <who name="Wenson Hsieh">wenson_hsieh</who>
    <bug_when>2018-11-02 08:25:29 -0700</bug_when>
    <thetext>(In reply to Piotrek Koszuliński (Reinmar) from comment #0)
&gt; I think this is a recent regression because this started to be reported to
&gt; us very recently (e.g. in
&gt; https://github.com/ckeditor/ckeditor5/issues/1321). 
&gt; 
&gt; To reproduce (on iOS):
&gt; 
&gt; 1. Open https://jsfiddle.net/hzkfdrgw/
&gt; 2. Place the selection in the textarea. Press the enter a couple of times.
&gt; 3. Scroll the viewport so the caret goes off screen.
&gt; 4. Type something.
&gt; 
&gt; Expected behaviour: the viewport is scrolled to show the selection.
&gt; 
&gt; Actual behaviour: the viewport is not scrolled.
&gt; 
&gt; Screencast: http://sendvid.com/qzpnxe3h
&gt; 
&gt; Severity: This is a quite serious issue due the fact that is super hard to
&gt; create a workaround for it that would work in mobile Safari due to Safari&apos;s
&gt; broken viewport when the software keyboard is visible. My tests
&gt; (https://github.com/ckeditor/ckeditor5/issues/1321#issuecomment-435330662)
&gt; show that on all other browsers we can reliably show the selection by
&gt; playing with `window.scrollTop`. But that algorithm doesn&apos;t work in mobile
&gt; Safari. I&apos;ll be filling a separate bug report about the viewport.

Thanks for the report, Piotrek! We&apos;re tracking this internally in &lt;rdar://problem/28300343&gt;. It looks like this is a regression that first appeared in iOS 10.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1474599</commentid>
    <comment_count>3</comment_count>
    <who name="Piotrek Koszuliński (Reinmar)">pkoszulinski</who>
    <bug_when>2018-11-02 12:58:43 -0700</bug_when>
    <thetext>Thank you Wenson for the good news! :)

BTW, I reported the other issue about the mobile Safari&apos;s weird viewport in https://bugs.webkit.org/show_bug.cgi?id=191204</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1474995</commentid>
    <comment_count>4</comment_count>
    <who name="Alberto Blanco">alberto</who>
    <bug_when>2018-11-05 01:47:49 -0800</bug_when>
    <thetext>Hope this issue can be picked up as soon as possible. In our user case it is really the missing component for a proper UX experience when writing an email. Not scrolling as you type is a very frustrating experience.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>