Skip to content

Commit

Permalink
Fix #5073: Refactor SelectButton behavior
Browse files Browse the repository at this point in the history
Add deprecated tag for unselectable prop
  • Loading branch information
habubey committed Oct 11, 2023
1 parent 2c201df commit 09e3349
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion components/lib/selectbutton/SelectButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const SelectButton = React.memo(

let selected = isSelected(event.option);

if (selected && (!props.unselectable || props.allowEmpty)) {
if (selected && !(props.unselectable || props.allowEmpty)) {
return;
}

Expand Down
1 change: 1 addition & 0 deletions components/lib/selectbutton/selectbutton.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export interface SelectButtonProps extends Omit<React.DetailedHTMLProps<React.In
multiple?: boolean | undefined;
/**
* Whether selection can be cleared.
* @deprecated Use 'allowEmpty' property instead.
* @defaultValue true
*/
unselectable?: boolean | undefined;
Expand Down

0 comments on commit 09e3349

Please sign in to comment.