Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.
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
14 changes: 6 additions & 8 deletions apps/client/src/widgets/tab_row.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ const TAB_ROW_TPL = `
overflow-y: hidden;
scrollbar-width: none; /* Firefox */
}

/* Chrome/Safari */
.tab-row-widget-scrolling-container::-webkit-scrollbar {
display: none;
Expand Down Expand Up @@ -391,15 +392,12 @@ export default class TabRowWidget extends BasicWidget {
return;
}
event.preventDefault();

const delta = Math.sign(wheelEvent.deltaX + wheelEvent.deltaY) *
Math.min(Math.abs(wheelEvent.deltaX + wheelEvent.deltaY), TAB_CONTAINER_MIN_WIDTH * 2);

this.scrollTabContainer(delta, "instant");
event.stopImmediatePropagation();
event.currentTarget.scrollLeft += wheelEvent.deltaY + wheelEvent.deltaX;
});

this.$scrollButtonLeft[0].addEventListener('click', () => this.scrollTabContainer(-200));
this.$scrollButtonRight[0].addEventListener('click', () => this.scrollTabContainer(200));
this.$scrollButtonLeft[0].addEventListener('click', () => this.scrollTabContainer(-210));
this.$scrollButtonRight[0].addEventListener('click', () => this.scrollTabContainer(210));

this.$tabScrollingContainer[0].addEventListener('scroll', () => {
clearTimeout(this.updateScrollTimeout);
Expand Down Expand Up @@ -731,7 +729,7 @@ export default class TabRowWidget extends BasicWidget {

const scorllContainerBounds = this.$tabScrollingContainer[0]?.getBoundingClientRect();
const pointerX = pointer.pageX;
const scrollSpeed = 100; // The increment of each scroll.
const scrollSpeed = 105; // The increment of each scroll.
// Check if the mouse is near the edge of the container and trigger scrolling.
if (pointerX < scorllContainerBounds.left) {
this.scrollTabContainer(- scrollSpeed);
Expand Down