Skip to content

Commit

Permalink
fix(Select): fix indeterminate status style (#2915)
Browse files Browse the repository at this point in the history
* fix(Menu): fix submenu classname

* fix(Select): fix indeterminate status
  • Loading branch information
uyarn authored May 20, 2024
1 parent 6164b4f commit 3fc0697
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/select/base/Option.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const Option: React.FC<SelectOptionProps> = (props) => {
} = props;

let selected: boolean;
let indeterminate: boolean;
const label = propLabel || value;
const disabled = propDisabled || (multiple && Array.isArray(selectedValue) && max && selectedValue.length >= max);

Expand Down Expand Up @@ -98,6 +99,7 @@ const Option: React.FC<SelectOptionProps> = (props) => {
});
if (props.checkAll) {
selected = selectedValue.length === props.optionLength;
indeterminate = selectedValue.length > 0 && !selected;
}
}

Expand All @@ -115,6 +117,7 @@ const Option: React.FC<SelectOptionProps> = (props) => {
return (
<label
className={classNames(`${classPrefix}-checkbox`, {
[`${classPrefix}-is-indeterminate`]: indeterminate,
[`${classPrefix}-is-disabled`]: disabled,
[`${classPrefix}-is-checked`]: selected,
})}
Expand Down

0 comments on commit 3fc0697

Please sign in to comment.