mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Combobox: only render ScrollContainer
when menu is open (#96271)
only render ScrollContainer when menu is open
This commit is contained in:
parent
69a38c634c
commit
265342fbae
@ -375,8 +375,9 @@ export const Combobox = <T extends string | number>(props: ComboboxProps<T>) =>
|
|||||||
'aria-labelledby': ariaLabelledBy,
|
'aria-labelledby': ariaLabelledBy,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
|
{isOpen && (
|
||||||
<ScrollContainer showScrollIndicators maxHeight="inherit" ref={scrollRef}>
|
<ScrollContainer showScrollIndicators maxHeight="inherit" ref={scrollRef}>
|
||||||
{isOpen && !asyncError && (
|
{!asyncError && (
|
||||||
<ul style={{ height: rowVirtualizer.getTotalSize() }} className={styles.menuUlContainer}>
|
<ul style={{ height: rowVirtualizer.getTotalSize() }} className={styles.menuUlContainer}>
|
||||||
{rowVirtualizer.getVirtualItems().map((virtualRow) => {
|
{rowVirtualizer.getVirtualItems().map((virtualRow) => {
|
||||||
return (
|
return (
|
||||||
@ -424,6 +425,7 @@ export const Combobox = <T extends string | number>(props: ComboboxProps<T>) =>
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</ScrollContainer>
|
</ScrollContainer>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user