mantinedev / mantine

A fully featured React components library
https://mantine.dev
MIT License
26.01k stars 1.85k forks source link

Wrong text-align in BaseInput #6543

Closed alimehasin closed 4 weeks ago

alimehasin commented 1 month ago

Dependencies check up

What version of @mantine/* packages do you have in package.json?

v7.11.2

What package has an issue?

@mantine/core

What framework do you use?

Next.js

In which browsers you can reproduce the issue?

All

Describe the bug

The BaseInput component does not respect the closest dir attribute. Specifically, when there are two nested div elements where the outer div has dir="rtl" and the inner div has dir="ltr", the text alignment of the <TextInput />and <NumberInput /> components within the inner div is incorrect.

If possible, include a link to a codesandbox with a minimal reproduction

https://codesandbox.io/p/sandbox/text-input-dir-issue-lw23kv

Possible fix

Remove text-align: var(--input-text-align); from Input.module.css

https://github.com/mantinedev/mantine/blob/c087030bbc67a895cb39475b0494ed5a6dc5e7ab/packages/%40mantine/core/src/components/Input/Input.module.css#L148

Self-service

alimehasin commented 1 month ago

Removing text-align will break PinInput

alimehasin commented 1 month ago

I think setting up text-align to inherit or initial would solve the problem in .wrapper

rtivital commented 4 weeks ago

It is not planned to change these styles, you can override text-align and other styles on your side per component with Styles API if the default styles do not meet your requirements.