Skip to content

Commit

Permalink
Fix(NcActionButton): Set submenu arrow direction in RTL mode
Browse files Browse the repository at this point in the history
Signed-off-by: Faisal Alghamdi <[email protected]>
  • Loading branch information
falghamdi125 committed Dec 8, 2024
1 parent f0ac2e8 commit 348e3f1
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/components/NcActionButton/NcActionButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,9 @@ export default {
<!-- default text display -->
<span v-else class="action-button__text">{{ text }}</span>

<!-- right arrow icon when there is a sub-menu -->
<ChevronRightIcon v-if="isMenu" :size="20" class="action-button__menu-icon" />
<!-- right(in LTR) or left(in RTL) arrow icon when there is a sub-menu -->
<ChevronRightIcon v-if="isMenu && !isRTL" :size="20" class="action-button__menu-icon" />
<ChevronLeftIcon v-else-if="isMenu && isRTL" :size="20" class="action-button__menu-icon" />
<CheckIcon v-else-if="isChecked === true" :size="20" class="action-button__pressed-icon" />
<span v-else-if="isChecked === false" class="action-button__pressed-icon material-design-icon" />

Expand All @@ -368,7 +369,9 @@ export default {
<script>
import CheckIcon from 'vue-material-design-icons/Check.vue'
import ChevronRightIcon from 'vue-material-design-icons/ChevronRight.vue'
import ChevronLeftIcon from 'vue-material-design-icons/ChevronLeft.vue'
import ActionTextMixin from '../../mixins/actionText.js'
import { isRTL } from '@nextcloud/l10n'

/**
* Button component to be used in Actions
Expand All @@ -379,6 +382,12 @@ export default {
components: {
CheckIcon,
ChevronRightIcon,
ChevronLeftIcon,
},
setup() {
return {
isRTL: isRTL(),
}
},
mixins: [ActionTextMixin],

Expand Down

0 comments on commit 348e3f1

Please sign in to comment.