Skip to content

Commit 50c4ede

Browse files
committed
Clear button flag.
New prop, 'clearable': Can the user clear the selected property? Usage, :clearable="false" (defaults to true.) See issue sagalbot#463.
1 parent 546b27d commit 50c4ede

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/components/Select.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,15 @@
423423
default: false
424424
},
425425
426+
/**
427+
* Can the user clear the selected property?
428+
* @type {Boolean}
429+
*/
430+
clearable: {
431+
type: Boolean,
432+
default: true
433+
},
434+
426435
/**
427436
* Sets the max-height property on the dropdown list.
428437
* @deprecated
@@ -1053,7 +1062,7 @@
10531062
* @return {Boolean}
10541063
*/
10551064
showClearButton() {
1056-
return !this.multiple && !this.open && this.mutableValue != null
1065+
return !this.multiple && this.clearable && !this.open && this.mutableValue != null
10571066
}
10581067
},
10591068

0 commit comments

Comments
 (0)