Skip to content

UDropdown animation incorrect in RTL mode, scaling is LTR-oriented #6256

@mmdfarajzadeh

Description

@mmdfarajzadeh

Environment

Nuxt: 4.3.1
NuxtUI: 4.6

Is this bug related to Nuxt or Vue?

Nuxt

Package

v4.x

Version

4.6

Reproduction

app.vue

<script setup lang="ts">
import type { DropdownMenuItem } from '@nuxt/ui'
 
const items = ref<DropdownMenuItem[]>([
  {
    label: 'Profile',
    icon: 'i-lucide-user'
  },
  {
    label: 'Billing',
    icon: 'i-lucide-credit-card'
  },
  {
    label: 'Settings',
    icon: 'i-lucide-cog'
  }
])
</script>
 
<template>
  <UApp dir="rtl">
    <UPageSection>
      <UDropdownMenu
        :items="items"
        :content="{
          align: 'start'
        }"
      >
        <UButton label="Open" icon="i-lucide-menu" color="neutral" variant="outline" />
      </UDropdownMenu>
    </UPageSection>
  </UApp>
</template>

nuxt.config.ts

export default defineNuxtConfig({
  app: {
    head: {
      htmlAttrs: {
        lang: 'fa',
        dir: 'rtl'
      }
    }
  }
})

Description

The UDropdown component’s opening animation behaves incorrectly in RTL mode.

In an LTR project:

When align is set to start, the dropdown menu appears anchored to the left and scales open from left to right.
When align is set to end, the dropdown menu anchors to the right and scales open from right to left.
However, in an RTL project:

The menu’s position is correctly determined by the align prop (e.g., align: 'start' correctly positions it to the right in RTL).
The problem: The opening scale animation remains LTR-oriented. For align: 'start', which should logically scale from right to left in RTL, it still scales from left to right. This creates a visual inconsistency, especially when the width of the dropdown menu does not match the width of the trigger button.

Additional context

No response

Logs

nRS3g0gFLGGhjIUhK46ICNv4W1IoXoJhCmkMQOxs.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions