Skip to content

Commit

Permalink
Add horizontal scrollbar for table part
Browse files Browse the repository at this point in the history
Signed-off-by: Laurent Fasani <[email protected]>
  • Loading branch information
lfasani committed May 23, 2024
1 parent 9efe158 commit aa9601c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/components/gantt/use-vertical-scrollbars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ export const useVerticalScrollbars = (): [
ganttTaskContentRef.current.scrollTop;
// On chrome, if a horizontal scrollbar is displayed in ganttTaskContentRef then the size of the gantt
// is greater. So, when scrolling gantt to the bottom it goes more in the bottom
// than the taskListContent part can. In in case, ganttTaskContentRef.current.scrollTop is too high
// Th line below allow to lower ganttTaskContentRef.current.scrollTop
// than the taskListContent part can. In this case, ganttTaskContentRef.current.scrollTop is too high
// The line below allow to lower ganttTaskContentRef.current.scrollTop
ganttTaskContentRef.current.scrollTop =
taskListContentRef.current.scrollTop;
} else {
ganttTaskContentRef.current.scrollTop =
taskListContentRef.current.scrollTop;
taskListContentRef.current.scrollTop =
ganttTaskContentRef.current.scrollTop;
}
};

Expand Down
1 change: 0 additions & 1 deletion src/components/task-list/task-list-table.module.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.taskListWrapper {
display: table;
border-bottom: #e6e4e4 1px solid;
}
4 changes: 3 additions & 1 deletion src/components/task-list/task-list.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
.ganttTableWrapper {
display: grid;
overflow: hidden;
grid-template-rows: min-content
grid-template-rows: min-content;
overflow-x: auto;
scrollbar-width: thin;
}

.ganttTableWrapper::-webkit-scrollbar {
Expand Down
1 change: 1 addition & 0 deletions src/components/task-list/task-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ const TaskListInner: React.FC<TaskListProps> = ({
),
backgroundSize: `100% ${fullRowHeight * 2}px`,
backgroundImage: `linear-gradient(to bottom, transparent ${fullRowHeight}px, #f5f5f5 ${fullRowHeight}px)`,
overflow: "hidden",
}}
>
<TaskListTable
Expand Down

0 comments on commit aa9601c

Please sign in to comment.