fix(sqllab): Table options rendering regression (#24142)
This commit is contained in:
parent
2b236cbbd6
commit
6a44e0ddd4
|
|
@ -47,6 +47,7 @@ import {
|
|||
selectAllOption,
|
||||
mapValues,
|
||||
mapOptions,
|
||||
hasCustomLabels,
|
||||
} from './utils';
|
||||
import { SelectOptionsType, SelectProps } from './types';
|
||||
import {
|
||||
|
|
@ -440,6 +441,11 @@ const Select = forwardRef(
|
|||
onChange?.(newValues, newOptions);
|
||||
};
|
||||
|
||||
const shouldRenderChildrenOptions = useMemo(
|
||||
() => selectAllEnabled || hasCustomLabels(options),
|
||||
[selectAllEnabled, options],
|
||||
);
|
||||
|
||||
const customMaxTagPlaceholder = () => {
|
||||
const num_selected = ensureIsArray(selectValue).length;
|
||||
const num_shown = maxTagCount as number;
|
||||
|
|
@ -493,6 +499,7 @@ const Select = forwardRef(
|
|||
<StyledCheckOutlined iconSize="m" aria-label="check" />
|
||||
)
|
||||
}
|
||||
{...(!shouldRenderChildrenOptions && { options: fullSelectOptions })}
|
||||
oneLine={oneLine}
|
||||
tagRender={customTagRender}
|
||||
{...props}
|
||||
|
|
@ -508,7 +515,8 @@ const Select = forwardRef(
|
|||
{selectAllLabel()}
|
||||
</Option>
|
||||
)}
|
||||
{renderSelectOptions(fullSelectOptions)}
|
||||
{shouldRenderChildrenOptions &&
|
||||
renderSelectOptions(fullSelectOptions)}
|
||||
</StyledSelect>
|
||||
</StyledContainer>
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue