File tree 1 file changed +2
-1
lines changed
packages/sanity/src/structure/panes/document/inspectors/changes
1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -20,12 +20,13 @@ export function HistorySelector({showList}: {showList: boolean}) {
20
20
const [ listHeight , setListHeight ] = useState ( 0 )
21
21
22
22
const getScrollerRef = useCallback ( ( el : HTMLDivElement | null ) => {
23
+ if ( ! el ?. clientHeight ) return
23
24
/**
24
25
* Hacky solution, the list height needs to be defined, it cannot be obtained from the parent using a `max-height: 100%`
25
26
* Because the scroller won't work properly and it won't scroll to the selected element on mount.
26
27
* To fix this, this component will set the list height to the height of the parent element - 1px, to avoid a double scroll line.
27
28
*/
28
- setListHeight ( el ? .clientHeight ? el . clientHeight - 1 : 0 )
29
+ setListHeight ( el . clientHeight - 1 )
29
30
setScrollRef ( el )
30
31
} , [ ] )
31
32
You can’t perform that action at this time.
0 commit comments