Skip to content
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

fix: Sweep issue using AR language in cardCarrousel component - EXO-74720 -Meeds-io/meeds#2530. #4135

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
absolute
left
x-small
@click="moveLeft">
@click="($vuetify.rtl) ? moveRight() : moveLeft()">
<v-icon size="25">fa-arrow-circle-left</v-icon>
</v-btn>
</v-fab-transition>
Expand All @@ -40,7 +40,7 @@
absolute
right
x-small
@click="moveRight">
@click="($vuetify.rtl) ? moveLeft() : moveRight()">
<v-icon size="25">fa-arrow-circle-right</v-icon>
</v-btn>
</v-fab-transition>
Expand Down Expand Up @@ -111,9 +111,12 @@ export default {
const contentWidth = this.scrollElement.firstChild.offsetWidth;
const children = this.scrollElement.firstChild.children;
const childrenCount = children.length;
const scrollElementLeft = (this.$vuetify.rtl) ? -this.scrollElement.scrollLeft : this.scrollElement.scrollLeft;
const visibilityIconArrowPrev = this.scrollElement && childrenCount && scrollElementLeft > children[0].offsetLeft;
const visibilityIconArrowNext = this.scrollElement && (this.scrollElement.scrollWidth - this.scrollElement.offsetWidth - scrollElementLeft) > 5;
this.visibleChildrenPerPage = parseInt(parentWidth * childrenCount / contentWidth);
this.displayLeftArrow = this.scrollElement && childrenCount && this.scrollElement.scrollLeft > children[0].offsetLeft;
this.displayRightArrow = this.scrollElement && (this.scrollElement.scrollWidth - this.scrollElement.offsetWidth - this.scrollElement.scrollLeft) > 5;
this.displayLeftArrow = (this.$vuetify.rtl) ? visibilityIconArrowNext : visibilityIconArrowPrev;
this.displayRightArrow = (this.$vuetify.rtl) ? visibilityIconArrowPrev : visibilityIconArrowNext;
if (!this.initialized && childrenCount) {
this.childScrollIndex = this.visibleChildrenPerPage >= children.length ? (children.length - 1) : this.visibleChildrenPerPage;
this.initialized = true;
Expand Down