Skip to content

[bug]: Dialog and AlertDialog components don't respect dir attribute for RTL layouts #8454

@hamzaODprogramer

Description

@hamzaODprogramer

Describe the bug

Bug Description
When using Dialog and AlertDialog components with RTL (right-to-left) languages, the content doesn't properly respond to the dir attribute set on the DialogContent or AlertDialogContent components.

Current Behavior
Text alignment remains left-aligned even with dir="rtl"
Dialog header and description don't flip to RTL layout
Footer buttons don't reverse order for RTL
Close button position doesn't adjust for RTL

Reproduction

<AlertDialog open={open}>
  <AlertDialogContent dir="rtl">
    <AlertDialogHeader>
      <AlertDialogTitle>عنوان التأكيد</AlertDialogTitle>
      <AlertDialogDescription>
        هل أنت متأكد من أنك تريد حذف هذا العنصر؟
      </AlertDialogDescription>
    </AlertDialogHeader>
    <AlertDialogFooter>
      <AlertDialogCancel>إلغاء</AlertDialogCancel>
      <AlertDialogAction>تأكيد</AlertDialogAction>
    </AlertDialogFooter>
  </AlertDialogContent>
</AlertDialog>

Affected component/components

AlertDialog

How to reproduce

<AlertDialog open={open}>
  <AlertDialogContent dir="rtl">
    <AlertDialogHeader>
      <AlertDialogTitle>عنوان التأكيد</AlertDialogTitle>
      <AlertDialogDescription>
        هل أنت متأكد من أنك تريد حذف هذا العنصر؟
      </AlertDialogDescription>
    </AlertDialogHeader>
    <AlertDialogFooter>
      <AlertDialogCancel>إلغاء</AlertDialogCancel>
      <AlertDialogAction>تأكيد</AlertDialogAction>
    </AlertDialogFooter>
  </AlertDialogContent>
</AlertDialog>

Codesandbox/StackBlitz link

No response

Logs

System Info

Win10
Google Chrome

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions