mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-08 16:37:15 +00:00
Fixed #5744 - Deprecated: InputChips
This commit is contained in:
parent
d75d9f9f3f
commit
446f7380dd
6 changed files with 98 additions and 25 deletions
|
@ -407,28 +407,30 @@ export default {
|
|||
this.clicked = false;
|
||||
},
|
||||
onInput(event) {
|
||||
if (this.searchTimeout) {
|
||||
clearTimeout(this.searchTimeout);
|
||||
}
|
||||
if (this.typeahead) {
|
||||
if (this.searchTimeout) {
|
||||
clearTimeout(this.searchTimeout);
|
||||
}
|
||||
|
||||
let query = event.target.value;
|
||||
let query = event.target.value;
|
||||
|
||||
if (!this.multiple) {
|
||||
this.updateModel(event, query);
|
||||
}
|
||||
if (!this.multiple) {
|
||||
this.updateModel(event, query);
|
||||
}
|
||||
|
||||
if (query.length === 0) {
|
||||
this.hide();
|
||||
this.$emit('clear');
|
||||
} else {
|
||||
if (query.length >= this.minLength) {
|
||||
this.focusedOptionIndex = -1;
|
||||
|
||||
this.searchTimeout = setTimeout(() => {
|
||||
this.search(event, query, 'input');
|
||||
}, this.delay);
|
||||
} else {
|
||||
if (query.length === 0) {
|
||||
this.hide();
|
||||
this.$emit('clear');
|
||||
} else {
|
||||
if (query.length >= this.minLength) {
|
||||
this.focusedOptionIndex = -1;
|
||||
|
||||
this.searchTimeout = setTimeout(() => {
|
||||
this.search(event, query, 'input');
|
||||
}, this.delay);
|
||||
} else {
|
||||
this.hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -633,15 +635,22 @@ export default {
|
|||
event.preventDefault();
|
||||
},
|
||||
onEnterKey(event) {
|
||||
if (!this.overlayVisible) {
|
||||
this.focusedOptionIndex = -1; // reset
|
||||
this.onArrowDownKey(event);
|
||||
} else {
|
||||
if (this.focusedOptionIndex !== -1) {
|
||||
this.onOptionSelect(event, this.visibleOptions[this.focusedOptionIndex]);
|
||||
if (!this.typeahead) {
|
||||
if (this.multiple) {
|
||||
this.updateModel(event, [...(this.modelValue || []), event.target.value]);
|
||||
this.$refs.focusInput.value = '';
|
||||
}
|
||||
} else {
|
||||
if (!this.overlayVisible) {
|
||||
this.focusedOptionIndex = -1; // reset
|
||||
this.onArrowDownKey(event);
|
||||
} else {
|
||||
if (this.focusedOptionIndex !== -1) {
|
||||
this.onOptionSelect(event, this.visibleOptions[this.focusedOptionIndex]);
|
||||
}
|
||||
|
||||
this.hide();
|
||||
this.hide();
|
||||
}
|
||||
}
|
||||
},
|
||||
onEscapeKey(event) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue