Please see this question. I experienced the same issue, and the answers to the linked question have resolved it. Unfortunately, a side-effect is that as the PopupWindow resizes itself to make space for the keyboard, it also moves it's position upward.
Is there a way to have the PopupWindow resize but keep it's original position?