Skip to content

Invert Carousel keyDown keys when direction is RTL #5048

@paulbarre

Description

@paulbarre

Package

v4.x

Description

When the current locale direction is RTL, the carousel arrows are moving the slide in their direction: left arrow button slides to the left, right arrow button slides to the right. Which is good.
However, using the keyboard when the carousel has the focus: the left arrow key slides to the right, the right arrow key slides to the left. It matches left=previous and right=next logic.

I think it would be more logic if the keydown event reflects the carousel arrows buttons.

I wasn't sure if it would be considered as a bug or not. Looking at the code, it seems the case was just not handled yet.

If this enhancement makes sense, I would be more than happy to make it my first contribution.

Additional context

Here is a small playground I coded to test the behavior.

  1. Use the button group to switch LTR and RTL.
  2. Click on the carousel to give it the focus.
  3. Use left and right arrow keys to see how it goes.

https://paulbarre.github.io/nuxt-ui-carousel-rtl/

You can find the code here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttriageAwaiting initial review and prioritizationv4#4488

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions