Fixed #2826 - SelectButton | new `unselectable` property
parent
79803baf11
commit
c7243d25dc
|
@ -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",
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue