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

TextField align right, (on rtl direction) result in no padding. #435

Open
pipech opened this issue Apr 4, 2024 · 5 comments
Open

TextField align right, (on rtl direction) result in no padding. #435

pipech opened this issue Apr 4, 2024 · 5 comments
Labels
request New feature or request

Comments

@pipech
Copy link

pipech commented Apr 4, 2024

Use-case

In some use-case, it's a good idea to align number in text field to right, so it would be easy to compared with other fields.

image

Actual Result

Using text-align: right

Result in no padding.

image

Using direction: ltr

It does display number with padding but the cursor behavior is incorrect, cursor will goes right when pressing left arrow.

image

Desire result

Without changing the direction, it would be nice to have a way to properly align text right.

Cause

Since radix using text-indent for the padding. It only works with the direction of the text.
image

Fix ??

Changing text-indent to padding-left and padding-right seems to solve the problems.

image

image

@vladmoroz vladmoroz added the request New feature or request label Apr 4, 2024
@vladmoroz
Copy link
Contributor

There’s a couple good reasons for why we use text-indent, but I agree that there should be a first-class way to do right-aligned input fields; center-aligned too. We'll look into it at some point.

For now feel free to use inline style overrides to achieve that.

@pipech
Copy link
Author

pipech commented Apr 4, 2024

Another issue pops up when the text gets really long – there's no padding on the right side.

image

@benoitgrelard
Copy link
Contributor

Another issue pops up when the text gets really long – there's no padding on the right side.

image

Pretty sure that one is intentional @vladmoroz right?

@vladmoroz
Copy link
Contributor

Another issue pops up when the text gets really long – there's no padding on the right side.

That's intentional – what the problem here?

@pipech
Copy link
Author

pipech commented Apr 5, 2024

Oh sorry, I always thought there should be padding on both sides.

I get that having padding on both sides looks nicer, but maybe the lack of padding could serve as a visual clue that the text is overflowing, right?

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

No branches or pull requests

3 participants