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

The errorProps aren't working in any component that depends on Input.Wrapper #2603

Closed
ghost opened this issue Oct 2, 2022 · 1 comment
Closed

Comments

@ghost
Copy link

ghost commented Oct 2, 2022

What package has an issue

@mantine/core

Describe the bug

The bug is described as follows: If I set size="xl" in the TextInput component and give the object {size : "xs"} as errorProps for the same component, the error size stays unchanged.

What version of @mantine/hooks page do you have in package.json?

5.5.0

If possible, please include a link to a codesandbox with the reproduced problem

https://codesandbox.io/s/black-wood-y55brg

Do you know how to fix the issue

Yes

Are you willing to participate in fixing this issue and create a pull request with the fix

Yes

Possible fix

Change line 143 in InputWrapper.tsx

// from this
<InputError {...errorProps} key="error" {...sharedProps}>

// to this
<InputError key="error" {...sharedProps} {...errorProps}>

Because the way the props are ordered is wrong the shared props will always overwrite the error props

@ghost ghost added the review required label Oct 2, 2022
rtivital added a commit that referenced this issue Oct 3, 2022
@rtivital
Copy link
Member

rtivital commented Oct 3, 2022

Fixed in 5.5.1

@rtivital rtivital closed this as completed Oct 3, 2022
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

No branches or pull requests

1 participant