How can I set material-ui TextField to accept only Hexidecimal characters

流过昼夜 提交于 2019-12-02 17:40:28

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!