Called whenever the text is committed. This happens when the user presses enter or the text box loses focus.