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

Fix NumberInput doesn't show helperText with an onBlur prop and mode='onBlur' #8403

Merged
merged 1 commit into from
Nov 22, 2022

Conversation

WiXSL
Copy link
Contributor

@WiXSL WiXSL commented Nov 18, 2022

No description provided.

@WiXSL WiXSL added the RFR Ready For Review label Nov 18, 2022
@WiXSL WiXSL changed the title Fix NumberInput don't show helperText error onBlur if its required Fix NumberInput doesn't show helperText error onBlur if its required Nov 18, 2022
@@ -46,6 +47,7 @@ export const NumberInput = ({
isRequired,
} = useInput({
defaultValue,
onBlur,
Copy link
Contributor Author

@WiXSL WiXSL Nov 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really sure why destructuring onBlur prop solves it, but it does

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It changes what you pass to the MUI TextField (via ...sanitizeInputRestProps(rest))

@@ -46,6 +47,7 @@ export const NumberInput = ({
isRequired,
} = useInput({
defaultValue,
onBlur,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It changes what you pass to the MUI TextField (via ...sanitizeInputRestProps(rest))

@slax57 slax57 added this to the 4.5.3 milestone Nov 22, 2022
@slax57 slax57 merged commit 2fa6b70 into master Nov 22, 2022
@slax57 slax57 deleted the fix-ni-blur branch November 22, 2022 10:21
@slax57 slax57 changed the title Fix NumberInput doesn't show helperText error onBlur if its required Fix NumberInput doesn't show helperText with an onBlur prop and mode='onBlur' Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants