Skip to content

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

Merged
ciampo merged 3 commits into
trunkfrom
fix/tabs-rtl
Oct 17, 2024
Merged

ciampo merged 3 commits into
trunkfrom
fix/tabs-rtl

Conversation

@ciampo

@ciampo ciampo commented Oct 17, 2024 •

Copy link
Copy Markdown
Contributor

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 a team and t-hamano October 17, 2024 10:40
@ciampo ciampo self-assigned this Oct 17, 2024
@github-actions

github-actions Bot commented Oct 17, 2024 •

Copy link
Copy Markdown

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

@tyxla tyxla left a comment

Copy link
Copy Markdown
Member

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 🚀

@t-hamano t-hamano left a comment

Copy link
Copy Markdown
Contributor

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?

@github-actions

Copy link
Copy Markdown

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
@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

ciampo commented Oct 17, 2024

Copy link
Copy Markdown
Contributor Author

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