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

NumberInput rightSectionWidth extends beyond right section and prevents clicking into input in that area #5033

Closed
Nantris opened this issue Oct 12, 2023 · 6 comments
Labels
Fixed patch Completed issues that will be published with next patch (1.0.X)

Comments

@Nantris
Copy link
Contributor

Nantris commented Oct 12, 2023

What package has an issue

@mantine/core

Describe the bug

The area just before the rightSection cannot be clicked to activate the input in v7. This was not an issue in v5/v6 and it's particularly problematic with small NumberInputs like shown below. The rightSection's extents are highlighted in red.

image

What version of @mantine/* packages do you have in package.json? (Note that all @mantine/* packages must have the same version in order to work correctly)

7.1.3

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

It can be reproduced by adjusting the width of the inputs on the demo page https://mantine.dev/core/number-input/

Do you know how to fix the issue

No

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

None

Possible fix

No response

@7iomka
Copy link
Contributor

7iomka commented Oct 13, 2023

This happens because rightSectionWidth by default have value equal to the input height, and controls are positioned inside of it.
This behavior can be improved by override rightSectionWidth value under the hood if it doesn't passed from props and if rightSection is not used for something else with NumberInput.
Alternative workaround is to use under the hood rightSectionPointerEvents="none" and override this value on controls.

@Nantris
Copy link
Contributor Author

Nantris commented Oct 14, 2023

Thanks for the reply @7iomka. If we define a custom rightSectionWidth then the values become uncentered:

With rightSectionWidth defined

image

Default positionining

image

@7iomka
Copy link
Contributor

7iomka commented Oct 14, 2023

Thanks for the reply @7iomka. If we define a custom rightSectionWidth then the values become uncentered:

With rightSectionWidth defined

image

Default positionining

image

I said that rightSectionWidth needed to have default override under the hood by library, not on your side.
In this case padding-x will contain this value + default padding and position will remain centered.

@Nantris
Copy link
Contributor Author

Nantris commented Oct 18, 2023

Thanks for your reply @7iomka. Sorry if I'm still not understanding correctly, you're saying this should be considered a bug in Mantine?

@7iomka
Copy link
Contributor

7iomka commented Oct 18, 2023

Thanks for your reply @7iomka. Sorry if I'm still not understanding correctly, you're saying this should be considered a bug in Mantine?

I suppose this is an overlooked issue that can be fixed in the above way by the author of the library

rtivital added a commit that referenced this issue Nov 7, 2023
@rtivital rtivital added the Fixed patch Completed issues that will be published with next patch (1.0.X) label Nov 7, 2023
@rtivital
Copy link
Member

rtivital commented Nov 7, 2023

Fixed in 7.2.1.

@rtivital rtivital closed this as completed Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed patch Completed issues that will be published with next patch (1.0.X)
Projects
None yet
Development

No branches or pull requests

3 participants