iachat/app/javascript/dashboard/components/ui
Sivin Varghese 696611ae63
feat: Add Teleport component to fix RTL/LTR utility classes (#11455)
# Pull Request Template

## Description

This PR introduces a `CustomTeleport` component that wraps Vue's
Teleport to preserve directionality context (ltr / rtl) when teleporting
content outside the app’s root container.

### Problem
Currently, the app sets the text direction (`[dir="ltr"]` or
`[dir="rtl"]`) on a container `div` inside `<body>`, not on `<body>`
itself. When content is teleported directly into `body`, it no longer
inherits the correct direction context. As a result, direction-aware
utility classes like `ltr:pl-2`, `rtl:ml-1`, etc., break because CSS
selectors like `[dir="ltr"] .ltr\:pl-2` no longer match. Identified this
issue when working on this
[PR](https://github.com/chatwoot/chatwoot/pull/11382)

### Solution
The `CustomTeleport` component automatically applies the correct `[dir]`
attribute (`ltr` or `rtl`) on the teleported content's wrapper based on
the current `isRTL` setting from the store. This ensures that
direction-specific Tailwind utility classes continue to work as
expected, even when the content is rendered outside the app root.

## Type of change

- [x] New feature (non-breaking change which adds functionality)


## Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [x] I have commented on my code, particularly in hard-to-understand
areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream
modules

---------

Co-authored-by: Pranav <pranavrajs@gmail.com>
2025-05-12 11:49:23 -07:00
..
DatePicker chore: Update date range picker with new theme colors (#11267) 2025-04-09 16:03:53 +05:30
Dropdown chore: Update buttons in dashboard (#11145) 2025-03-31 17:21:32 -07:00
Tabs feat: Support bigger font size in dashboard (#10974) 2025-02-27 12:10:33 +05:30
Banner.vue chore: Update buttons in dashboard (#11145) 2025-03-31 17:21:32 -07:00
ContextMenu.vue feat: Add Teleport component to fix RTL/LTR utility classes (#11455) 2025-05-12 11:49:23 -07:00
DateRangePicker.vue style: apply fixes for eslint issues [cw-3590] (#10210) 2024-10-03 15:02:12 +05:30
DateTimePicker.vue style: apply fixes for eslint issues [cw-3590] (#10210) 2024-10-03 15:02:12 +05:30
HelperTextPopup.vue feat: Eslint rules (#9839) 2024-08-05 14:02:16 +05:30
Label.vue chore(v4): Update colors (#10700) 2025-01-16 15:27:23 +05:30
PreviewCard.vue feat: Support bigger font size in dashboard (#10974) 2025-02-27 12:10:33 +05:30
Switch.vue feat: Support bigger font size in dashboard (#10974) 2025-02-27 12:10:33 +05:30
TimeAgo.vue feat: update colors for v4 (#10660) 2025-01-15 17:13:03 +05:30
Wizard.vue chore: Update styles in settings pages (#11070) 2025-03-18 14:40:02 -07:00