That has nothing to do with your code. The user can move the keyboard from the bottom of the screen or split it. You have done exactly that as the user. You, as the user, need to drag the keyboard down again if that's what you want.
And you don't do anything about it, because it is behaviour that the user intentionally chose. For people who write code that keeps track of the keyboard appearing / disappearing and moving items out of the area covered by the keyboard: If the keyboard is undocked or split, or if the user uses a hardware keyboard, you will get no notifications about the area covered by the keyboard.