How to deal with landscape orientation?

The crux of the matter: the mobile version of the website some elements when rotating in landscape mode needs to escape. I implemented this using media query @media screen and (orientation:landscape) {}.
On the page there is a feedback form. When focusing on any imput the keyboard appears and it all breaks. Mobile browser overrides the device orientation to landscape and media work. I understand that the preview pane when invoking the keyboard really becomes a landscape, but this is not the case.
Please tell me how to overcome that.
July 2nd 19 at 17:07
1 answer
July 2nd 19 at 17:09
Probably, they should not hide through media, but through JS with the terms of the aspect ratio + input is not in focus (or open the keyboard is, if it can be verified)
we have more options to consider. I can write a little code, but is it really necessary to fence in-house options for such simple task - Fannie_Mohr commented on July 2nd 19 at 17:12

Find more questions by tags jQueryCSSJavaScript