Is it possible to get the raw string value of TextField with type="number"? #24194
-
I'm writing a component wrapping a number TextField to allow scientific notation input and other custom validation. We want to keep type as number for the existing validation and incremental buttons. I can get the value of the TextField from various functions when the input is valid, however when the input is invalid the value is always returned as an empty string, and I can't seem to find any way of getting the value of the invalid input string, which is necessary for our own internal validation and state management. Apart from the unstable solution of catching every input event and building our own idea of what the value is, I can't seem to find any way of achieving this. Any help would be appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The v8 and v9 TextField only allows strings for the value. Even our spin buttons, which simulate the UI of are still string based. You'll need to convert the number to string going in, and then back to number on the way out. All of the internal logic assumes it is a string. |
Beta Was this translation helpful? Give feedback.
The v8 and v9 TextField only allows strings for the value. Even our spin buttons, which simulate the UI of are still string based. You'll need to convert the number to string going in, and then back to number on the way out. All of the internal logic assumes it is a string.