问题
I want my TextField to accept only the values from 0-9 and letters A-F. Thanks.
回答1:
See the Formatted Inputs portion of the documentation.
Here is an example I put together (using the formatted inputs demo code as a starting point) using react-text-mask that only accepts up to 8 hexidecimal characters:
来源:https://stackoverflow.com/questions/53981996/how-can-i-set-material-ui-textfield-to-accept-only-hexidecimal-characters