Skip to content

Commit

Permalink
fix(Carousel): use dir from locale (#2647)
Browse files Browse the repository at this point in the history
  • Loading branch information
Malik-Jouda authored Nov 15, 2024
1 parent 0daac5b commit 1fbbfe8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/runtime/components/Carousel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,7 @@ const options = computed<EmblaOptionsType>(() => ({
...(props.fade ? { align: 'center', containScroll: false } : {}),
...rootProps.value,
axis: props.orientation === 'horizontal' ? 'x' : 'y',
// TODO: Get from ConfigProvider
direction: 'ltr'
direction: dir.value === 'rtl' ? 'rtl' : 'ltr'
}))
const plugins = computedAsync<EmblaPluginType[]>(async () => {
Expand Down
4 changes: 2 additions & 2 deletions src/theme/carousel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export default (options: Required<ModuleOptions>) => ({
vertical: {
container: 'flex-col -mt-4',
item: 'pt-4',
prev: '-top-12 left-1/2 -translate-x-1/2 rotate-90',
next: '-bottom-12 left-1/2 -translate-x-1/2 rotate-90'
prev: '-top-12 left-1/2 -translate-x-1/2 rotate-90 rtl:-rotate-90',
next: '-bottom-12 left-1/2 -translate-x-1/2 rotate-90 rtl:-rotate-90'
},
horizontal: {
container: 'flex-row -ms-4',
Expand Down

0 comments on commit 1fbbfe8

Please sign in to comment.