mit-cml:ucr
← preetvadaliya:text-watcher
opened 01:24PM - 19 Sep 21 UTC
## New Text Watcher Events in TextBox & PasswordTextBox Components
This PR ad…ds support of Text Watcher events into TexBox and PasswordTextBox components.
### BeforeTextChanged
The event is raised when the characters are about to be replaced with some new text. The text is uneditable. This event is used when you need to take a look at the old text which is about to change.
**Params**
1. **oldText**: the old text
2. **start**: is the start index of text that is about to be deleted
3. **count**: is the length of the text that is about to be deleted
4. **after**: is the length of the text that is about to be added
### OnTextChanged
The event is raised when changes have been made, some characters have just been replaced. The text is uneditable. This event is used when you need to see which characters in the text are new.
**Params**
1. **newText** the new text
2. **start** is the start index of the text that just got added, This is the same as the start of BeforeTextChanged.
3. **before** is the length of the text that just got deleted, This is the same as the count of BeforeTextChanged.
4. **count** is the length of the text that just got added, This is the same as the after of BeforeTextChanged.
### AfterTextChanged
The same as OnTextChanged, except now the text box is editable. This event is used when you need to see and possibly edit new text.