Skip to content

Commit c3dab36

Browse files
authored
When linking to a column, show the column in the center instead of the top so it doesn't hide behind the sticky header (#1940)
Signed-off-by: Kristen Armes <[email protected]>
1 parent 7a0366f commit c3dab36

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

frontend/amundsen_application/static/js/components/Table/constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ export const ARRAY_CLOSER = '] ';
1717
export const MAP_LABEL = 'map';
1818
export const MAP_OPENER = ' {';
1919
export const MAP_CLOSER = '} ';
20+
21+
export const SCROLL_INTO_VIEW_BLOCK = 'center';

frontend/amundsen_application/static/js/components/Table/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {
2424
MAP_VALUE_NAME,
2525
MAP_KEY_DISPLAY_NAME,
2626
MAP_VALUE_DISPLAY_NAME,
27+
SCROLL_INTO_VIEW_BLOCK,
2728
} from './constants';
2829
import './styles.scss';
2930

@@ -798,7 +799,7 @@ const useTableHooks = ({
798799
const expandRowRef = React.useRef<HTMLTableRowElement>(null);
799800
React.useEffect(() => {
800801
if (expandRowRef.current !== null) {
801-
expandRowRef.current.scrollIntoView();
802+
expandRowRef.current.scrollIntoView({ block: SCROLL_INTO_VIEW_BLOCK });
802803
}
803804
}, []);
804805

0 commit comments

Comments
 (0)