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

USelect and UInputMenu don't support RTL language. #3538

Closed
ArbazIrshad opened this issue Mar 12, 2025 · 4 comments · Fixed by #3611
Closed

USelect and UInputMenu don't support RTL language. #3538

ArbazIrshad opened this issue Mar 12, 2025 · 4 comments · Fixed by #3611
Labels
bug Something isn't working v3 #1289

Comments

@ArbazIrshad
Copy link
Contributor

Environment

  • Operating System: Darwin
  • Node Version: v22.9.0
  • Nuxt Version: 3.16.0
  • CLI Version: 3.22.5
  • Nitro Version: 2.11.6
  • Package Manager: npm@10.8.3
  • Builder: -
  • User Config: devtools, modules, i18n, ssr, runtimeConfig, app, css, vite, compatibilityDate
  • Runtime Modules: @nuxtjs/i18n@9.3.1, @nuxt/ui@3.0.0
  • Build Modules: -

Is this bug related to Nuxt or Vue?

Nuxt

Version

3.0.0-beta.4

Reproduction

Use any RTL language with USelect and UInputMenu component.

Description

Currently, both USelect and UInput Menu don't support rtl direction. The placeholder should be on the right side and the icon on the left side of the field.

In USelect, you can see that even the dropdown is not properly aligned according to language.

Image

While the popover label are aligned properly for UInputMenu, the placeholder and arrow is still not in proper direction.
Image

Same with these tags components, it's direction should be reversed too.
Image

Additional context

No response

Logs

@ArbazIrshad ArbazIrshad added bug Something isn't working triage v3 #1289 labels Mar 12, 2025
Copy link
Member

@malik-jouda any hint on this?

@malik-jouda
Copy link
Contributor

@benjamincanac @ArbazIrshad
This language is Urdu, and it is not on the list of supported languages.
https://ui.nuxt.com/getting-started/i18n/nuxt#custom-locale

<script setup lang="ts">
import type { Messages } from '@nuxt/ui'

const locale = defineLocale<Messages>({
  name: 'Urdu',
  code: 'ur',
  dir: 'rtl',
  messages: {
    // implement pairs
  }
})
</script>

<template>
  <UApp :locale="locale">
    <NuxtPage />
  </UApp>
</template>

Ensure dir: 'rtl' for proper direction.

@ArbazIrshad
Copy link
Contributor Author

@malik-jouda Weird that it doesn't respect my default (RTL) direction that I have set in my header and I have provide it custom locale for it to work.

@malik-jouda
Copy link
Contributor

malik-jouda commented Mar 19, 2025

@ArbazIrshad

https://reka-ui.com/docs/utilities/config-provider

When creating localized apps that require right-to-left (RTL) reading direction, you need to wrap your application with the ConfigProvider component to ensure all of the primitives adjust their behavior based on the dir prop.

Image Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v3 #1289
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants