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

Tabs and TabPanel: Fix arrow key navigation in RTL #66201

Merged
merged 3 commits into from
Oct 17, 2024
Merged

Tabs and TabPanel: Fix arrow key navigation in RTL #66201

merged 3 commits into from
Oct 17, 2024

Conversation

ciampo
Copy link
Contributor

@ciampo ciampo commented Oct 17, 2024

What?

Part of #64963

Respect writing direction when using arrow keys to navigate the tabs in the Tabs and TabPanel components

Why?

We should respect the writing direction

How?

using the rtl utility to detect writing direction, and passing that information to the underlying ariakit store

Testing Instructions

  • See default Storybook story for Tabs and TabPanel
  • Toggle the examples to RTL mode in the toolbar.
  • Test that arrow key navigation works as expected.

Screenshots or screencast

Before (trunk) After (this PR)
Kapture.2024-10-17.at.12.37.45.mp4
Kapture.2024-10-17.at.12.38.28.mp4

@ciampo ciampo requested a review from ajitbohra as a code owner October 17, 2024 10:40
@ciampo ciampo requested review from t-hamano and a team October 17, 2024 10:40
@ciampo ciampo self-assigned this Oct 17, 2024
Copy link

github-actions bot commented Oct 17, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@ciampo ciampo added [Type] Bug An existing feature does not function as intended [Package] Components /packages/components labels Oct 17, 2024
Copy link
Member

@tyxla tyxla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well in my testing. Thanks 🚀

Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The strange thing is that the TabPanel component (not the Tabs component) originally worked fine with RTL languages, so removing this line doesn't seem to change the result 🤔

Do you know anything about this?

Copy link

Flaky tests detected in 7de9f4d.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11383326372
📝 Reported issues:

@ciampo ciampo merged commit 605e9df into trunk Oct 17, 2024
65 checks passed
@ciampo ciampo deleted the fix/tabs-rtl branch October 17, 2024 15:24
@github-actions github-actions bot added this to the Gutenberg 19.6 milestone Oct 17, 2024
@ciampo
Copy link
Contributor Author

ciampo commented Oct 17, 2024

The strange thing is that the TabPanel component (not the Tabs component) originally worked fine with RTL languages, so removing this line doesn't seem to change the result 🤔

Do you know anything about this?

Nope, no idea 🙈 But I wouldn't spend too much time on it, since the plan is to deprecate TabPanel in favour of Tabs as soon as it's stable

karthick-murugan pushed a commit to karthick-murugan/gutenberg that referenced this pull request Nov 13, 2024
Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants