Replacing the text as you type is usually a bad idea. It makes it impossible to press the backspace, arrow keys or do any other editing operations. It is usually better (from a user experience point of view) to format, replace, etc. after the user has finished typing the text.
Said that, let’s get back to the question you actually asked
If you really want to change the text while the user is typing it, as @ianb suggests, you can use the change
event of the input component.
If you think that changing the text as the user types and preventing them from editing it would be to harsh, you can use the lost_focus
and or pressed_enter
events.