mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Fix ambigious clearing behaviour on SelectButton (#4107)
This commit is contained in:
parent
0a08c56d3b
commit
b666789c8a
5 changed files with 27 additions and 2 deletions
|
@ -16,6 +16,10 @@ export default {
|
|||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
allowEmpty: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
disabled: Boolean,
|
||||
dataKey: null,
|
||||
'aria-labelledby': {
|
||||
|
|
|
@ -155,10 +155,16 @@ export interface SelectButtonProps {
|
|||
*/
|
||||
dataKey?: string | undefined;
|
||||
/**
|
||||
* Whether selection can be cleared.
|
||||
* Whether selection can not be cleared.
|
||||
* @defaultValue false
|
||||
* @deprecated Use 'allowEmpty' property instead.
|
||||
*/
|
||||
unselectable?: boolean | undefined;
|
||||
/**
|
||||
* Whether selection can be cleared.
|
||||
* @defaultValue true
|
||||
*/
|
||||
allowEmpty?: boolean | undefined;
|
||||
/**
|
||||
* Identifier of the underlying element.
|
||||
*/
|
||||
|
|
|
@ -81,7 +81,7 @@ export default {
|
|||
|
||||
let selected = this.isSelected(option);
|
||||
|
||||
if (selected && this.unselectable) {
|
||||
if (selected && (this.unselectable || !this.allowEmpty)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue