Improve expanding and collapsing and begin text input. Text input is currently unidirectional