From 4736dac5ff722b521fce526489159e38eec55caf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Tue, 17 Oct 2023 09:32:11 +0300 Subject: [PATCH] Fixed #4631 - SelectButton: unselectable property defect --- components/lib/selectbutton/BaseSelectButton.vue | 2 +- components/lib/selectbutton/SelectButton.d.ts | 4 ++-- components/lib/selectbutton/SelectButton.vue | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/lib/selectbutton/BaseSelectButton.vue b/components/lib/selectbutton/BaseSelectButton.vue index c2018299f..590fa3792 100644 --- a/components/lib/selectbutton/BaseSelectButton.vue +++ b/components/lib/selectbutton/BaseSelectButton.vue @@ -14,7 +14,7 @@ export default { multiple: Boolean, unselectable: { type: Boolean, - default: false + default: true }, allowEmpty: { type: Boolean, diff --git a/components/lib/selectbutton/SelectButton.d.ts b/components/lib/selectbutton/SelectButton.d.ts index e8c1a6369..31890a734 100755 --- a/components/lib/selectbutton/SelectButton.d.ts +++ b/components/lib/selectbutton/SelectButton.d.ts @@ -155,8 +155,8 @@ export interface SelectButtonProps { */ dataKey?: string | undefined; /** - * Whether selection can not be cleared. - * @defaultValue false + * Whether selection can be cleared. + * @defaultValue true * @deprecated Use 'allowEmpty' property instead. */ unselectable?: boolean | undefined; diff --git a/components/lib/selectbutton/SelectButton.vue b/components/lib/selectbutton/SelectButton.vue index 08ea3fc7b..5da48a5f0 100755 --- a/components/lib/selectbutton/SelectButton.vue +++ b/components/lib/selectbutton/SelectButton.vue @@ -81,7 +81,7 @@ export default { let selected = this.isSelected(option); - if (selected && (this.unselectable || !this.allowEmpty)) { + if (selected && !(this.unselectable && this.allowEmpty)) { return; }