Note that there are some explanatory texts on larger screens.

plurals
  1. POFixed headers with text fields on mobile safari websites
    primarykey
    data
    text
    <p>I've been looking around for awhile, and I can't seem to find any fix for this issue. When an input field gains focus in mobile safari (haven't checked other browsers) a fixed element will jump due to safari putting that element in view (closer to the center). The error only occurs when a user has scrolled, if the user is still at the top of the page nothing occurs.</p> <p>Before &amp; After screenshots</p> <p><img src="https://i.stack.imgur.com/cDuI0.png" alt="before focus"></p> <p><img src="https://i.stack.imgur.com/mW2h0.png" alt="after focus"></p> <p>Does anyone have a clue how to fix this? The only solution I have come across is to scroll back to the top when focused, then on blur scroll back into position... this seems like a very sloppy solution.</p> <p>Here's the example site in the screenshots, very basic, nothing out of the norm.</p> <pre><code> &lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="utf-8" /&gt; &lt;meta name="viewport" content="width=device-width, scale=1"/&gt; &lt;title&gt;MySite&lt;/title&gt; &lt;style&gt; body{ height:100%; width:100%; padding:0; margin:0; font-size:16px; font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; } header, footer { background-color:#333; padding:10px; color:#FFF; width:100%; } header { position:fixed; top:0; left:0; } input[type=search] { position:relative; margin-left:20px; width:160px; font-size:16px; height:26px; } section{ padding:10px; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;header&gt; &lt;b&gt;MySite&lt;/b&gt; &lt;input type='search' placeholder='Search'&gt; &lt;/header&gt; &lt;section&gt; &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&lt;/p&gt; &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&lt;/p&gt; &lt;/sction&gt; &lt;footer&gt; &amp;copy; MySite &lt;?php echo date('Y') ?&gt; &lt;/footer&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload