iPhone X Safari fixed button on bottom needs two clicks to respond

Guy picture Guy · Jan 23, 2018 · Viewed 10.8k times · Source

We've placed a fixed button on the bottom of the webpage using:

fixed button #1

It works with Safari and Chrome on all devices. However, on iPhone X, after you scroll down and try to click the button it first shows the bar:

bar

and only then the fixed button is clickable. This means users need to click twice, hence it can potentially reduce the conversion rates. We are wondering:

  1. Is there a way to always show the bar on iPhone X?
  2. Is there a way to allow a click on the first try?

UPDATE: After applying Daniel's suggestion visually there seems to be a padding. As I've added:

   .CTA-container {
        margin-bottom: env(safe-area-inset-bottom);
    }

with padding on iPhone X

Nevertheless, the behavior continues and two click are required.

Answer

Daniel A. White picture Daniel A. White · Jan 23, 2018

According to this site, use env(safe-area-inset-bottom) for additional padding:

.CTA-container {
  padding-bottom: env(safe-area-inset-bottom);
}