Refactor code to hide keyboard after change the window.