<?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>176205</bug_id>
          
          <creation_ts>2017-08-31 17:36:04 -0700</creation_ts>
          <short_desc>On webkit ios there is now way for accounting for virtual keyboard height</short_desc>
          <delta_ts>2019-03-09 19:34:25 -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>DOM</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>170982</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sam Saffron">sam.saffron</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>albertofdzm</cc>
    
    <cc>bugzilla</cc>
    
    <cc>j.jaffeux</cc>
    
    <cc>ph</cc>
    
    <cc>rniwa</cc>
    
    <cc>thorton</cc>
    
    <cc>wenson_hsieh</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1344240</commentid>
    <comment_count>0</comment_count>
    <who name="Sam Saffron">sam.saffron</who>
    <bug_when>2017-08-31 17:36:04 -0700</bug_when>
    <thetext>Height 100% on Webkit is treated as height behind virtual keyboard (regardless of virtual keyboard visibility). There appears to be no method of actually getting the height of the visual viewport. 

On Android you can create fixed panel with height 100% and it automatically sized to the visual viewport. This makes it significantly simpler to account for the virtual keyboard. In iOS it is very very hacky. 

I wish there was another mechanism of either getting the virtual keyboard visibility and height or setting height to actual visible viewport.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1383043</commentid>
    <comment_count>1</comment_count>
    <who name="Sam Saffron">sam.saffron</who>
    <bug_when>2017-12-18 20:14:26 -0800</bug_when>
    <thetext>Anything ideas here, window.height is bogus innerHeight bogus, there is pretty much no way of telling</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1384859</commentid>
    <comment_count>2</comment_count>
    <who name="Joffrey Jaffeux">j.jaffeux</who>
    <bug_when>2017-12-28 06:16:28 -0800</bug_when>
    <thetext>This issue is a major source of pain for any ambitious web only app, fixing it would greatly help people following this way.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1388780</commentid>
    <comment_count>3</comment_count>
    <who name="">ph</who>
    <bug_when>2018-01-12 06:11:04 -0800</bug_when>
    <thetext>This is a major problem for any web app that relies rich text input functionality. Trying to create a advanced chat experience using auto-scroll features seems nearly impossible for iOS 11.

A similar issue for an open source rich text editor is documented here: https://github.com/ianstormtaylor/slate/issues/1513#issuecomment-356554052

We need a reliable way to determine the actual viewport of users here with correctly considers the on-screen keyboard on touch devices.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1413693</commentid>
    <comment_count>4</comment_count>
    <who name="Alberto Fernandez Medina">albertofdzm</who>
    <bug_when>2018-04-11 08:40:28 -0700</bug_when>
    <thetext>I have this same issue.

Our whole app layout relies on html,body {height: 100%;} making it almost impossible to deal with this bug when the users need to use the keyboard.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1503261</commentid>
    <comment_count>5</comment_count>
    <who name="Lucas Forschler">lforschler</who>
    <bug_when>2019-02-06 09:18:51 -0800</bug_when>
    <thetext>Mass move bugs into the DOM component.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1512625</commentid>
    <comment_count>6</comment_count>
    <who name="Sheng Slogar">bugzilla</who>
    <bug_when>2019-03-05 06:17:45 -0800</bug_when>
    <thetext>Is there any update on this? I&apos;m having a similar issue and haven&apos;t found any solutions -- even hacky ones -- that mitigate this bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1512639</commentid>
    <comment_count>7</comment_count>
    <who name="Wenson Hsieh">wenson_hsieh</who>
    <bug_when>2019-03-05 07:29:56 -0800</bug_when>
    <thetext>The visual viewport API should assist with this (see: https://bugs.webkit.org/show_bug.cgi?id=170982), but note that this is currently only enabled by default in trunk WebKit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1512647</commentid>
    <comment_count>8</comment_count>
    <who name="Sheng Slogar">bugzilla</who>
    <bug_when>2019-03-05 08:36:17 -0800</bug_when>
    <thetext>(In reply to Wenson Hsieh from comment #7)
&gt; The visual viewport API should assist with this (see:
&gt; https://bugs.webkit.org/show_bug.cgi?id=170982), but note that this is
&gt; currently only enabled by default in trunk WebKit.

Thanks, Wenson! This looks promising. It works great with the virtual keyboard on Android but the real issue is iOS, so hopefully support comes there.

My only concern is polling `window.innerHeight` on iOS doesn&apos;t provide any height difference with the keyboard open so I wonder if this would give correct numbers...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1512889</commentid>
    <comment_count>9</comment_count>
    <who name="Sam Saffron">sam.saffron</who>
    <bug_when>2019-03-05 15:51:56 -0800</bug_when>
    <thetext>(In reply to Wenson Hsieh from comment #7)
&gt; The visual viewport API should assist with this (see:
&gt; https://bugs.webkit.org/show_bug.cgi?id=170982), but note that this is
&gt; currently only enabled by default in trunk WebKit.

As soon as trunk is folded into an iOS beta I would be glad to test this. Let me know.

I am also with @Sheng, I found `window.innerHeight` to be incredibly unreliable on current iOS. It sometimes works and changes, but sometimes it takes 10-20 seconds in polling every millisecond to change when virtual keyboard is expanded. 

Our current approach here is just to force users to tick a box that says &quot;hey, I am using a physical keyboard on my iPad&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1514479</commentid>
    <comment_count>10</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2019-03-09 19:34:02 -0800</bug_when>
    <thetext>(In reply to Sam Saffron from comment #9)
&gt; (In reply to Wenson Hsieh from comment #7)
&gt; &gt; The visual viewport API should assist with this (see:
&gt; &gt; https://bugs.webkit.org/show_bug.cgi?id=170982), but note that this is
&gt; &gt; currently only enabled by default in trunk WebKit.
&gt; 
&gt; As soon as trunk is folded into an iOS beta I would be glad to test this.
&gt; Let me know.
&gt; 
&gt; I am also with @Sheng, I found `window.innerHeight` to be incredibly
&gt; unreliable on current iOS. It sometimes works and changes, but sometimes it
&gt; takes 10-20 seconds in polling every millisecond to change when virtual
&gt; keyboard is expanded. 
&gt; 
&gt; Our current approach here is just to force users to tick a box that says
&gt; &quot;hey, I am using a physical keyboard on my iPad&quot;

With visual viewport API, can just listen for &quot;resize&quot; event on window.visualViewport.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1514480</commentid>
    <comment_count>11</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2019-03-09 19:34:25 -0800</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 170982 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>