Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextFieldLazy handling for numeric inputs #2124

Closed
frzyc opened this issue May 15, 2024 · 0 comments · Fixed by #2128
Closed

TextFieldLazy handling for numeric inputs #2124

frzyc opened this issue May 15, 2024 · 0 comments · Fixed by #2128

Comments

@frzyc
Copy link
Owner

frzyc commented May 15, 2024

Using MUI textfield is somewhat annoying, since using type='number' allows a bunch of non strictly numbers, like e,-, which has traditionally been hard to parse.

MUI team advices against using this as well: https://mui.com/material-ui/react-text-field/#type-quot-number-quot

Handling for numeric inputs should follow more like this example: https://codesandbox.io/p/sandbox/https-github-com-mui-material-ui-issues-36415-orxx4r?file=%2Fsrc%2FApp.tsx

For TextFieldLazy, need to pass in a regex prop that facilities this behaviour, or create a separate component for handling number inputs, like NumberInputLazy(might be easier to migrate to Number Input once MUI team releases it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant