I have a div that acts as an overlay; I'm using position: fixed
to accomplish this. In the overlay, I have a button. Normally, this works perfectly, but we've discovered a very strange bug that appears to be within Safari in iOS 10 on Plus-sized iPhones.
<div style="position: fixed; top: 0; left: 0; width: 100%; height: 100%; padding: 50px; background: rgba(0, 0, 0, 0.25);">
<input type="button" value="Input Button" />
<button>Button</button>
</div>
<div>
This is the regular div. This is the regular div.
<br />This is the regular div. This is the regular div.
<br />This is the regular div. This is the regular div.
<br />This is the regular div. This is the regular div.
<br />This is the regular div. This is the regular div.
<br />This is the regular div. This is the regular div.
<br />This is the regular div. This is the regular div.
<br />This is the regular div. This is the regular div.
<br />This is the regular div. This is the regular div.
<br />This is the regular div. This is the regular div.
<br />This is the regular div. This is the regular div.
<br />This is the regular div. This is the regular div.
<br />This is the regular div. This is the regular div.
<br />This is the regular div. This is the regular div.
<br />This is the regular div. This is the regular div.
<br />This is the regular div. This is the regular div.
<br />This is the regular div. This is the regular div.
<br />This is the regular div. This is the regular div.
<br />This is the regular div. This is the regular div.
<br />This is the regular div. This is the regular div.
<br />This is the regular div. This is the regular div.
<br />This is the regular div. This is the regular div.
<br />This is the regular div. This is the regular div.
<br />
<div style="position: fixed; top: 0; left: 0; width: 100%; height: 100%; padding: 50px; background: rgba(0, 0, 0, 0.25);">
<input type="button" value="Input Button" />
<button class="pull-right">Button</button>
</div>
</div>
Steps to Reproduce
- Confirm that the Tab Bar in Safari is enabled.
- Open at least 2 tabs.
- In portrait mode, load the page in question, with the
position: fixed
div visible. - Rotate the phone to the landscape orientation.
Safari should now show the Tab Bar at the top of the screen, under the Address Bar. But if you try to press the button, it will not do anything. Instead, you have to press above the button (more specifically, about the height of the button above the button) and Safari will act like you now pressed the button.
Clarification: The Tab Bar does not show when in portrait mode, even when the Tab Bar setting is enabled; it only shows after you rotate to landscape, which is where the DOM or some rendering of the page gets "unsynced" in Safari.
What is even more strange is that if you rotate the device back to portrait and again to landscape an additional time (after steps 1 through 4 above), the button's "hitbox" will be shifted vertically yet again, which means now you have to press above the button roughly twice the height of the button up.
This is happening on iOS 10.1.1 but I'm unsure about other versions. Confirmed on both an iPhone 7 Plus and a 6S Plus. I did find this webkit bug which appears to be closely related but possibly different.
Any ideas?