-
Notifications
You must be signed in to change notification settings - Fork 344
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
improve RTL mode #625
improve RTL mode #625
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -15,11 +15,11 @@ | |||||||||||||||||||
<table class="w-full table-auto"> | ||||||||||||||||||||
<thead class=""> | ||||||||||||||||||||
<tr> | ||||||||||||||||||||
<th class="text-left p-2 w-auto max-w-xs" /> | ||||||||||||||||||||
<th class="ltr:text-left rtl:text-right p-2 w-auto max-w-xs" /> | ||||||||||||||||||||
<td | ||||||||||||||||||||
v-for="column in columns" | ||||||||||||||||||||
:key="column" | ||||||||||||||||||||
class="border-l border-gray-300 max-w-24 overflow-hidden" | ||||||||||||||||||||
class="ltr:border-l rtl:border-r rtl:!border-l-0 border-gray-300 max-w-24 overflow-hidden" | ||||||||||||||||||||
> | ||||||||||||||||||||
<div class="p-2 w-full flex items-center justify-center text-sm"> | ||||||||||||||||||||
{{ column }} | ||||||||||||||||||||
|
@@ -33,15 +33,15 @@ | |||||||||||||||||||
:key="rowIndex" | ||||||||||||||||||||
class="border-t border-gray-300" | ||||||||||||||||||||
> | ||||||||||||||||||||
<td class="text-left w-auto max-w-24 overflow-hidden"> | ||||||||||||||||||||
<td class="ltr:text-left rtl:text-right w-auto max-w-24 overflow-hidden"> | ||||||||||||||||||||
<div class="w-full p-2 text-sm"> | ||||||||||||||||||||
{{ row }} | ||||||||||||||||||||
</div> | ||||||||||||||||||||
</td> | ||||||||||||||||||||
<td | ||||||||||||||||||||
v-for="column in columns" | ||||||||||||||||||||
:key="row + column" | ||||||||||||||||||||
class="border-l border-gray-300 hover:!bg-gray-100 dark:hover:!bg-gray-800" | ||||||||||||||||||||
class="ltr:border-l rtl:border-r rtl:!border-l-0 border-gray-300 hover:!bg-gray-100 dark:hover:!bg-gray-800" | ||||||||||||||||||||
:class="{ | ||||||||||||||||||||
'!cursor-not-allowed !bg-gray-200 dark:!bg-gray-800 hover:!bg-gray-200 dark:hover:!bg-gray-800': disabled, | ||||||||||||||||||||
}" | ||||||||||||||||||||
Comment on lines
+44
to
47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Simplify styles and fix potential dark mode conflicts The current implementation has some potential issues with style specificity and dark mode interactions: - class="ltr:border-l rtl:border-r rtl:!border-l-0 border-gray-300 hover:!bg-gray-100 dark:hover:!bg-gray-800"
- :class="{
- '!cursor-not-allowed !bg-gray-200 dark:!bg-gray-800 hover:!bg-gray-200 dark:hover:!bg-gray-800': disabled,
- }"
+ class="ltr:border-l rtl:border-r border-gray-300 dark:border-gray-600 group"
+ :class="{
+ 'cursor-not-allowed bg-gray-200 dark:bg-gray-800': disabled,
+ 'hover:bg-gray-100 dark:hover:bg-gray-800': !disabled
+ }" Changes:
📝 Committable suggestion
Suggested change
|
||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -14,7 +14,7 @@ | |||||
v-model="selectedCountryCode" | ||||||
:class="theme.PhoneInput.countrySelectWidth" | ||||||
dropdown-class="max-w-[300px]" | ||||||
input-class="rounded-r-none" | ||||||
input-class="ltr-only:rounded-r-none rtl:!rounded-l-none" | ||||||
:data="countries" | ||||||
:disabled="disabled || countries.length === 1 ? true : null" | ||||||
:searchable="true" | ||||||
|
@@ -55,7 +55,7 @@ | |||||
<input | ||||||
v-model="inputVal" | ||||||
type="text" | ||||||
class="inline-flex-grow !border-l-0 !rounded-l-none" | ||||||
class="inline-flex-grow ltr-only:border-l-0 ltr-only:!rounded-l-none rtl:border-r-0 rtl:rounded-r-none" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Ensure consistent use of !important modifiers in RTL/LTR classes. While the RTL/LTR implementation is correct, there's an inconsistency in the use of
This could lead to styling inconsistencies if there are competing styles. Apply this change for consistency: -class="inline-flex-grow ltr-only:border-l-0 ltr-only:!rounded-l-none rtl:border-r-0 rtl:rounded-r-none"
+class="inline-flex-grow ltr-only:border-l-0 ltr-only:!rounded-l-none rtl:!border-r-0 rtl:!rounded-r-none" 📝 Committable suggestion
Suggested change
|
||||||
:disabled="disabled ? true : null" | ||||||
:class="[ | ||||||
theme.PhoneInput.input, | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Critical: Hardcoded LTR direction conflicts with RTL support
The review comment is correct. The evidence shows:
useAppStore
is referenced)The suggested fix to make it dynamic based on the store's
isRTL
value is the right approach:🔗 Analysis chain
Critical: Hardcoded LTR direction contradicts RTL support objective
The PR aims to improve RTL mode support, but this change hardcodes the direction to 'ltr' which prevents proper RTL rendering for right-to-left languages (e.g., Arabic, Hebrew).
Consider making the direction dynamic:
Let's verify if other components are properly handling RTL mode:
Let me try another search strategy to verify RTL support:
Let me try one final search to check for any RTL-related state management:
Let me try one final search to check the app configuration and store:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 136205
Script:
Length of output: 731
Script:
Length of output: 131574
Script:
Length of output: 1224