fix: dropdown with the height of the sticky div (#605)
This commit is contained in:
parent
910c68ba77
commit
a8d6ff04e4
1 changed files with 11 additions and 1 deletions
|
|
@ -707,6 +707,7 @@ const ComboBox = React.forwardRef((props: ComboBoxProps, ref) => {
|
|||
}, [inputRef.current, props.isMainInput, persistSession]);
|
||||
|
||||
const deleteButtonDivRef = React.useRef<HTMLDivElement>(null);
|
||||
const stickyDropdownHeaderDiv = React.useRef<HTMLDivElement>(null);
|
||||
|
||||
const selectContextItemFromDropdown = useCallback(
|
||||
(event: any) => {
|
||||
|
|
@ -1408,6 +1409,7 @@ const ComboBox = React.forwardRef((props: ComboBoxProps, ref) => {
|
|||
>
|
||||
{nestedContextProvider && (
|
||||
<div
|
||||
ref={stickyDropdownHeaderDiv}
|
||||
style={{
|
||||
backgroundColor: secondaryDark,
|
||||
borderBottom: `0.5px solid ${lightGray}`,
|
||||
|
|
@ -1431,7 +1433,15 @@ const ComboBox = React.forwardRef((props: ComboBoxProps, ref) => {
|
|||
{nestedContextProvider.description}
|
||||
</div>
|
||||
)}
|
||||
<div style={{ maxHeight: `${UlMaxHeight - 50}px`, overflow: "auto" }}>
|
||||
<div
|
||||
style={{
|
||||
maxHeight: `${
|
||||
UlMaxHeight -
|
||||
(stickyDropdownHeaderDiv.current?.clientHeight || 50)
|
||||
}px`,
|
||||
overflow: "auto",
|
||||
}}
|
||||
>
|
||||
{downshiftProps.isOpen &&
|
||||
items.map((item, index) => (
|
||||
<Li
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue