M
M
Maxim Gerasimenko2018-02-20 10:53:38
css
Maxim Gerasimenko, 2018-02-20 10:53:38

What to do with position:fixed in iOS?

Good day to all!
There is an online callback form on the maxg5.ru website .
When entering from Iphone and trying to display data in the phone field, the carriage jumps to the description field.
Also on the Home page there is a timer, it flickers when scrolling, but only on Iphone.
There is a suspicion that both problems are related.
The first problem is partially solved by setting the modal window to position:absolute; instead of position:fixed. But in this case, when opening a modal window, it does not open in the center of the screen and you have to scroll the page up.
Is it possible to fully solve the problem of position: fixed in iOS?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita, 2018-02-20
@maxg5

When opening a modal window on body, add the class:

.show-modal {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
}

Accordingly, when closing, delete the class . I
recommend using media to register this class, only for mobile

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question