Skip to content

Commit

Permalink
rename function and fix the condition
Browse files Browse the repository at this point in the history
  • Loading branch information
justinpark committed May 19, 2023
1 parent 75dca7f commit 2bba1f9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions superset-frontend/src/components/Select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,8 @@ const Select = forwardRef(
onChange?.(newValues, newOptions);
};

const shouldUseChildrenOptions = useMemo(
() => !selectAllEnabled || hasCustomLabels(options),
const shouldRenderChildrenOptions = useMemo(
() => selectAllEnabled || hasCustomLabels(options),
[selectAllEnabled, options],
);

Expand Down Expand Up @@ -499,7 +499,7 @@ const Select = forwardRef(
<StyledCheckOutlined iconSize="m" aria-label="check" />
)
}
{...(!shouldUseChildrenOptions && { options: fullSelectOptions })}
{...(!shouldRenderChildrenOptions && { options: fullSelectOptions })}
oneLine={oneLine}
tagRender={customTagRender}
{...props}
Expand All @@ -515,7 +515,8 @@ const Select = forwardRef(
{selectAllLabel()}
</Option>
)}
{shouldUseChildrenOptions && renderSelectOptions(fullSelectOptions)}
{shouldRenderChildrenOptions &&
renderSelectOptions(fullSelectOptions)}
</StyledSelect>
</StyledContainer>
);
Expand Down

0 comments on commit 2bba1f9

Please sign in to comment.