I ran the code you provided and it is working as expected. The modal will shift to put input fields in a visible area. If the modal won't shift, then input fields at the bottom will get hidden by the keyboard.
Let me know if I have misunderstood your question, and provide more details or a reproducible code.