From 1d7cbcabee7ca491591380a64bca8cd81ae7a750 Mon Sep 17 00:00:00 2001 From: Chandragupt Gosavi <59999646+chandraguptgosavi@users.noreply.github.com> Date: Thu, 23 Jan 2025 21:11:57 +0530 Subject: [PATCH] fix: scrolling inside the table with scrollbar (#9753) Fixed- when scrolling inside the table with scrollbar, cursor also selects rows. Now on scrolling with scrollbar content is scrolled in respective direction as expected and table rows don't get selected. fixes issue #6773 --------- Co-authored-by: nitin <142569587+ehconitin@users.noreply.github.com> Co-authored-by: ehconitin --- .../utilities/scroll/components/ScrollWrapper.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/twenty-front/src/modules/ui/utilities/scroll/components/ScrollWrapper.tsx b/packages/twenty-front/src/modules/ui/utilities/scroll/components/ScrollWrapper.tsx index 9709422b0..0e7af457f 100644 --- a/packages/twenty-front/src/modules/ui/utilities/scroll/components/ScrollWrapper.tsx +++ b/packages/twenty-front/src/modules/ui/utilities/scroll/components/ScrollWrapper.tsx @@ -139,7 +139,18 @@ export const ScrollWrapper = ({ }, events: { updated: (osInstance) => { - const { scrollOffsetElement: target } = osInstance.elements(); + const { + scrollOffsetElement: target, + scrollbarVertical, + scrollbarHorizontal, + } = osInstance.elements(); + + if (scrollbarVertical !== null) { + scrollbarVertical.track.dataset.selectDisable = 'true'; + } + if (scrollbarHorizontal !== null) { + scrollbarHorizontal.track.dataset.selectDisable = 'true'; + } setScrollBottom( target.scrollHeight - target.clientHeight - target.scrollTop, );