diff --git a/apps/frontend/src/components/ui/moderation/ModerationProjectNags.vue b/apps/frontend/src/components/ui/moderation/ModerationProjectNags.vue index 20723d3046..cb5a0452dd 100644 --- a/apps/frontend/src/components/ui/moderation/ModerationProjectNags.vue +++ b/apps/frontend/src/components/ui/moderation/ModerationProjectNags.vue @@ -43,8 +43,11 @@ />
props.project.status === 'processing') const nagScroller = ref(null) +const canScrollNags = ref(false) const showLeftNagShadow = ref(false) const showRightNagShadow = ref(false) const draggingNags = ref(false) @@ -224,13 +228,16 @@ let suppressNagClickTimeout: ReturnType | null = null function updateNagScrollShadows() { const el = nagScroller.value if (!el) { + canScrollNags.value = false showLeftNagShadow.value = false showRightNagShadow.value = false return } - showLeftNagShadow.value = el.scrollLeft > 0 - showRightNagShadow.value = el.scrollLeft < el.scrollWidth - el.clientWidth - 1 + canScrollNags.value = el.scrollWidth > el.clientWidth + 1 + showLeftNagShadow.value = canScrollNags.value && el.scrollLeft > 0 + showRightNagShadow.value = + canScrollNags.value && el.scrollLeft < el.scrollWidth - el.clientWidth - 1 } function onNagWheel(event: WheelEvent) { @@ -244,7 +251,13 @@ function onNagWheel(event: WheelEvent) { function onNagPointerDown(event: PointerEvent) { const el = nagScroller.value - if (!el || event.pointerType === 'touch' || event.button !== 0) return + if ( + !el || + el.scrollWidth <= el.clientWidth + 1 || + event.pointerType === 'touch' || + event.button !== 0 + ) + return nagDragPointerId = event.pointerId nagDragStartX = event.clientX