There is a list of fonts. The user selects a font, closes the list. Opens the list again and the user automatically scrolls to the desired font.
<ListIndex listEl="list.virtual-list" scrollList={true} label={true}>
<List virtualList virtualListParams={{
items: fonts,
renderExternal: renderExternal,
}}>
<ul>
{vlFonts.vlData.items.map((item, index) => (
<ListItem
key={index}
radio
checked={curFontName === item.name}
title={item.name}
style={{fontFamily: `${item.name}`, top: `${vlFonts.vlData.topPosition}px`}}
onClick={() => { props.changeFont(item.name)}}
></ListItem>
))}
</ul>
</List>
</ListIndex>
I use ListIndex, but when clicking on the font list, an error occurs - Cannot read property âoffsetHeightâ of undefined. What am I doing wrong?