Create item on enter.
This commit is contained in:
parent
9f7bacede8
commit
3405ac3cc1
@ -103,11 +103,15 @@ export default {
|
||||
recopyItemsObject: function () {
|
||||
this.searchResults = this.initialItems.map(x => ({...x}));
|
||||
},
|
||||
searchItem: function () {
|
||||
if (this.searchQ.length > 0) {
|
||||
this.searchResults = this.searchResults.filter(i => i.content.toLowerCase().indexOf(this.searchQ.toLowerCase()) >= 0)
|
||||
searchItem: function (e) {
|
||||
if (e.key === 'Enter') {
|
||||
this.createItem();
|
||||
} else {
|
||||
this.recopyItemsObject();
|
||||
if (this.searchQ.length > 0) {
|
||||
this.searchResults = this.searchResults.filter(i => i.content.toLowerCase().indexOf(this.searchQ.toLowerCase()) >= 0)
|
||||
} else {
|
||||
this.recopyItemsObject();
|
||||
}
|
||||
}
|
||||
},
|
||||
addItem: function (item) {
|
||||
|
Loading…
Reference in New Issue
Block a user