Are you closing and reopening the keyboard
or just changing focus with it open?
The app doesn't have any control over the keyboard so there's not much you can do to work around this programmatically, but you may try futzing with the focus. This may cause flicker and the cure could end up worse than the disease though.