Skip to content

Commit 1cb7a9c

Browse files
author
Amrit Kashyap Borah
committed
fix: dont scroll to view on horizontal scroll
1 parent 44d758f commit 1cb7a9c

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/Shared/Components/Table/TableContent.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,15 @@ const TableContent = ({
124124
}
125125

126126
const focusActiveRow = (node: HTMLDivElement) => {
127-
if (node && !['INPUT', 'TEXTAREA'].includes(document.activeElement.tagName.toUpperCase())) {
127+
if (
128+
node &&
129+
!['INPUT', 'TEXTAREA'].includes(document.activeElement.tagName.toUpperCase()) &&
130+
node.dataset.active === 'true'
131+
) {
128132
node.focus({ preventScroll: true })
129133
scrollToShowActiveElementIfNeeded(node, rowsContainerRef.current, headerRef.current?.offsetHeight)
134+
// eslint-disable-next-line no-param-reassign
135+
node.dataset.active = 'false'
130136
}
131137
}
132138

0 commit comments

Comments
 (0)