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

Zotov picture Zotov · Dec 30, 2018 · Viewed 8k times · Source

I want my TextField to accept only the values from 0-9 and letters A-F. Thanks.

Answer

Ryan Cogswell picture Ryan Cogswell · Dec 31, 2018

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:

Edit 6v444wnvp3