Skip to content

Commit

Permalink
🔀 Merge #1966 into deploy/rinkeby
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraHuang22 committed Dec 11, 2024
2 parents 09a5fd1 + 257274c commit 1deca6c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/pages/store/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@
// NOTE: Prevent cropping the last tag button shadow
{ 'pr-[12px]': index === bookstoreTagButtons.length - 1 },
]"
@dragstart.prevent
>
<ButtonV2
class="pointer-event-auto"
:preset="
tag.id === selectedTagId ||
(!selectedTagId && tag.id === 'featured')
Expand Down Expand Up @@ -1359,10 +1361,12 @@ export default {
},
handleTagsContainerScroll() {
const container = this.$refs.tagsContainer;
const tolerance = 2;
this.isTagsContainerAtStart = container.scrollLeft === 0;
this.isTagsContainerAtStart = container.scrollLeft <= 0;
this.isTagsContainerAtEnd =
container.scrollLeft + container.clientWidth >= container.scrollWidth;
container.scrollLeft + container.clientWidth >=
container.scrollWidth - tolerance;
},
scrollTagsContainerLeft() {
const container = this.$refs.tagsContainer;
Expand All @@ -1383,12 +1387,15 @@ export default {
},
scrollTagsContainerRight() {
const container = this.$refs.tagsContainer;
const tolerance = 2;
const remainingScrollLeft =
container.scrollWidth -
container.clientWidth -
container.scrollLeft -
TAGS_CONTAINER_SCROLL_BY_SIZE;
const isNearEnd = remainingScrollLeft < TAGS_CONTAINER_SCROLL_BY_SIZE;
const isNearEnd =
remainingScrollLeft <= TAGS_CONTAINER_SCROLL_BY_SIZE + tolerance;
if (isNearEnd) {
container.scrollTo({
left: container.scrollWidth,
Expand Down

0 comments on commit 1deca6c

Please sign in to comment.