updateInput() is called every time text changes, thus every change leads to recalculating layout
updateInput()