iachat/app/javascript/dashboard
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
..
api feat: Allow customizing the responses, flows in Captain (#11385) 2025-04-29 15:42:15 -07:00
assets chore: Update date range picker with new theme colors (#11267) 2025-04-09 16:03:53 +05:30
components feat: Add Teleport component to fix RTL/LTR utility classes (#11455) 2025-05-12 11:49:23 -07:00
components-next feat: Add Teleport component to fix RTL/LTR utility classes (#11455) 2025-05-12 11:49:23 -07:00
composables feat: Add support for minutes in auto resolve feature (#11269) 2025-05-07 00:36:15 -07:00
constants feat: Add visibility checks for installation types (#10773) 2025-02-21 14:48:31 -08:00
helper fix: Add missing 'hc' path segment after custom domain in article URLs (#11353) 2025-04-22 21:53:50 +05:30
i18n chore: Update translations (#11458) 2025-05-10 19:21:34 -07:00
mixins chore: fix circleci on vite build (#10214) 2024-10-07 15:27:41 +05:30
modules chore: Update buttons in dashboard (#11145) 2025-03-31 17:21:32 -07:00
routes feat: Add support for typing events in webhooks (#11423) 2025-05-08 17:28:35 -07:00
store feat: Add support for minutes in auto resolve feature (#11269) 2025-05-07 00:36:15 -07:00
App.vue feat: Upgrade page instead of banner (#11202) 2025-03-28 02:28:17 -07:00
featureFlags.js feat: Instagram Inbox using Instagram Business Login (#11054) 2025-04-08 10:47:41 +05:30