refactored text_input drawing and interaction.