NumberTextBox.isValid does not work with trim
Open
- Dominant language
- HTML
- Stars
- 172
- Forks
- 180
- PR merge metrics
- No merged PRs in 30d
Description
I have
```html
```
and check in the code
```js
numberTextBox.on("change", () => {
okButton.set("disabled", numberTextBox.isValid());
});
```
This does not work when user enters a number with spaces, e.g. " 12 ". The checkbox show no error, but `numberTextBox.isValid()` returns `false`. I.e. if `isValid()` checks text value, it should do filter first.
**Update:** Workaround is to call `NumberTextBox._setBlurValue()` on change:
```js
numberTextBox.on("change", () => {
numberTextBox._setBlurValue();
okButton.set("disabled", numberTextBox.isValid());
});
```
Contributor guide
Assessment
This issue has not been assessed yet.