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

InputControl/TextControl: Force direction to LTR for certain fields #65893

Open
t-hamano opened this issue Oct 6, 2024 · 0 comments · May be fixed by #68188
Open

InputControl/TextControl: Force direction to LTR for certain fields #65893

t-hamano opened this issue Oct 6, 2024 · 0 comments · May be fixed by #68188
Labels
l10n Localization and translations best practices [Package] Components /packages/components [Type] Enhancement A suggestion for improvement.

Comments

@t-hamano
Copy link
Contributor

t-hamano commented Oct 6, 2024

What problem does this address?

For example, in the email and url fields, the text direction is usually expected to be ltr.

There is a style in WordPress core that will change the direction to ltr:

https://github.com/t-hamano/wordpress-develop/blob/a51f2e45c4a76878dbd0ab90782d44a07b29d13a/src/wp-content/themes/twentytwentyone/assets/sass/04-elements/forms.scss#L57-L62

However, this style does not necessarily apply to the block editor.

For example, in the Embed block that uses the InputControl with a url type, the direction is RTL, as shown below:

Image

What is your proposed solution?

As with core, if the type attribute is url or email, I suggest adding direction: ltr.

However, there seem to be various approaches to making form fields RTL-compatible. Please refer to the following article:

Interface localisation: adapting text fields for RTL languages | by Mitya Kuznetsov | Bumble Tech | Medium

@t-hamano t-hamano added [Package] Components /packages/components [Type] Enhancement A suggestion for improvement. l10n Localization and translations best practices labels Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
l10n Localization and translations best practices [Package] Components /packages/components [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant