common implementation for user typed text