-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Writing flow: fix RTL issues #31159
Writing flow: fix RTL issues #31159
Conversation
Size Change: -23 B (0%) Total Size: 1.49 MB
ℹ️ View Unchanged
|
ef64b80
to
7cb3e02
Compare
7cb3e02
to
1672915
Compare
* | ||
* @return {boolean} True if rtl, false if ltr. | ||
*/ | ||
export default function isRTL( element ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the existing wp.i18n.isRTL not enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works in any environment and it's contextual to the element. Different elements may have different directions. Generally, I think it's good to avoid globals.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We used to have different ways of checking RTL and we consolidate on one recently and I fear this puts us a bit back to more inconsistency.
Now, if the per element logic is something we really need in this use case, I think it's good to have, otherwise I feel we should just consolidate using wp.i18n.isRTL
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then perhaps we should revert to not exposing the function but leaving the check by element as it was before.
Description
Discovered in #31138. The current e2e tests are not catching the issue, probably because of timing. It's reproducible manually if you test horizontal arrow navigation between blocks.
How has this been tested?
Screenshots
Types of changes
Checklist:
*.native.js
files for terms that need renaming or removal).