Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/api/props.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,11 @@ Selectize.js theme
```js
theme: { default: '', type: String }
```

## clearSearchText

Allows component to delete whole option

```js
clearSearchText: { default: false, type: Boolean }
```
11 changes: 10 additions & 1 deletion src/components/VSelectize.vue
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ export default {
* Selectize theme
*/
theme: { default: '', type: String },

/**
* Allows component to delete whole option
*/
clearSearchText: { default: false, type: Boolean }
},

data: () => ({
Expand Down Expand Up @@ -511,9 +516,13 @@ export default {
if (typeof option === 'object' && option !== undefined) {
option = option[this.label]
}
if (this.multiple) {

if (this.multiple && this.clearSearchText) {
this.searchText = ''
} else if(this.multiple) {
this.searchText = option !== undefined ? option : ''
}

this.emitInput()
this.updateInputWidth()
}
Expand Down