@@ -10,8 +10,6 @@ import throttle from 'lodash/throttle';
1010import * as React from 'react' ;
1111import { VList } from 'virtua' ;
1212
13- const MUI_LIST_VERTICAL_PADDING = 8 ;
14-
1513interface ItemDataElement {
1614 props : React . HTMLAttributes < HTMLElement > ;
1715 option : React . ReactNode ;
@@ -28,20 +26,18 @@ const ListboxComponent = ({
2826} ) => {
2927 const itemData = ( children as ItemDataElement [ ] ) . slice ( ) ;
3028 const { itemCount, loadNextPage } = props . pagination ;
31- const [ optionHeightsTotal , setOptionHeightsTotal ] = React . useState (
32- MUI_LIST_VERTICAL_PADDING * 2 ,
33- ) ;
29+ const [ optionHeightsTotal , setOptionHeightsTotal ] = React . useState ( 0 ) ;
3430
3531 React . useEffect ( ( ) => {
3632 if ( ! isNextPageLoading ) {
37- setOptionHeightsTotal ( MUI_LIST_VERTICAL_PADDING * 2 ) ;
33+ setOptionHeightsTotal ( 0 ) ;
3834 }
3935 } , [ isNextPageLoading ] ) ;
4036
4137 React . useEffect ( ( ) => {
4238 if ( optionHeightsTotal < document . documentElement . clientHeight * 0.4 ) {
4339 const options = document . getElementsByClassName ( 'MuiAutocomplete-option' ) ;
44- let total = MUI_LIST_VERTICAL_PADDING * 2 ;
40+ let total = 0 ;
4541 for ( const option of options ) {
4642 total += option . clientHeight ;
4743 }
@@ -70,8 +66,6 @@ const ListboxComponent = ({
7066 < VList
7167 style = { {
7268 flex : 1 ,
73- paddingTop : MUI_LIST_VERTICAL_PADDING ,
74- paddingBottom : MUI_LIST_VERTICAL_PADDING ,
7569 } }
7670 onRangeChange = { ( _ , lastItemIndex ) => {
7771 if (
0 commit comments