From 09e33498150df709b321049830297698c1d96497 Mon Sep 17 00:00:00 2001 From: habubey Date: Wed, 11 Oct 2023 12:58:17 +0300 Subject: [PATCH] Fix #5073: Refactor SelectButton behavior Add deprecated tag for unselectable prop --- components/lib/selectbutton/SelectButton.js | 2 +- components/lib/selectbutton/selectbutton.d.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/components/lib/selectbutton/SelectButton.js b/components/lib/selectbutton/SelectButton.js index 28a7b69a07..1673906b0c 100644 --- a/components/lib/selectbutton/SelectButton.js +++ b/components/lib/selectbutton/SelectButton.js @@ -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; } diff --git a/components/lib/selectbutton/selectbutton.d.ts b/components/lib/selectbutton/selectbutton.d.ts index 7811e8db4e..31219be908 100644 --- a/components/lib/selectbutton/selectbutton.d.ts +++ b/components/lib/selectbutton/selectbutton.d.ts @@ -119,6 +119,7 @@ export interface SelectButtonProps extends Omit