Skip to content

Image lightbox: ArrowLeft and ArrowRight move the wrong way on right-to-left sites #87179

Open

Description

@SainathPoojary

Description

In the Image lightbox on a right-to-left (RTL) site, the Previous button is on the right and the Next button is on the left. The ArrowLeft key always goes to Previous and the ArrowRight key always goes to Next, whatever the text direction.

Expected: ArrowRight shows the same image as the button on the right, and ArrowLeft shows the same image as the button on the left.

Actual: ArrowRight shows the image of the button on the left, and ArrowLeft shows the image of the button on the right.

The Tabs block had the same problem, fixed in #86429.

Step-by-step reproduction instructions

  1. Set the site language to an RTL language, such as Arabic (Settings > General > Site Language).
  2. Publish a post with a Gallery of 3 images and "Expand on click" turned on.
  3. View the post and open the lightbox on the middle image.
  4. Press ArrowRight. It should show the same image as the button on the right shows when clicked.
  5. Press ArrowLeft. It should show the same image as the button on the left shows when clicked.

Screenshots, screen recording, code snippet

2026-11-21.00-30-29.mp4

Environment info

  • WordPress: 7.2-alpha-64498
  • Subdirectory: No
  • PHP: 8.3.35
  • Server: Apache/2.4.68 (Debian)
  • Database: mysqli (Server: 12.3.3-MariaDB-ubu2404 / Client: mysqlnd 8.3.35)
  • Browser: Chrome 157.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-Five 1.5
  • MU Plugins: None activated
  • Plugins:
    • Gutenberg 24.5.0-rc.1
    • Test Reports 1.3.1

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions