Fixed #2826 - SelectButton | new `unselectable` property

pull/2835/head
Tuğçe Küçükoğlu 2022-08-04 17:20:01 +03:00
parent 79803baf11
commit c7243d25dc
4 changed files with 24 additions and 0 deletions

View File

@ -47,6 +47,12 @@ const SelectButtonProps = [
default: "null",
description: "A property to uniquely identify an option."
},
{
name: "unselectable",
type: "boolean",
default: "true",
description: "Whether selection can be cleared."
},
{
name: "aria-labelledby",
type: "string",

View File

@ -51,6 +51,10 @@ export interface SelectButtonProps {
* A property to uniquely identify an option.
*/
dataKey?: string | undefined;
/**
* Whether selection can be cleared.
*/
unselectable?: boolean | undefined;
/**
* Identifier of the underlying element.
*/

View File

@ -23,6 +23,10 @@ export default {
optionValue: null,
optionDisabled: null,
multiple: Boolean,
unselectable: {
type: Boolean,
default: true
},
disabled: Boolean,
dataKey: null,
'aria-labelledby': {
@ -67,6 +71,10 @@ export default {
}
let selected = this.isSelected(option);
if (selected && !this.unselectable) {
return;
}
let optionValue = this.getOptionValue(option);
let newValue;

View File

@ -106,6 +106,12 @@ export default {
<td>false</td>
<td>When specified, allows selecting multiple values.</td>
</tr>
<tr>
<td>unselectable</td>
<td>boolean</td>
<td>true</td>
<td>Whether selection can be cleared.</td>
</tr>
<tr>
<td>disabled</td>
<td>boolean</td>