mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-08 16:37:15 +00:00
Refactor #5721
This commit is contained in:
parent
b37dd8d4d6
commit
be1cf3625b
5 changed files with 124 additions and 43 deletions
|
@ -197,7 +197,7 @@ export default {
|
|||
name: 'AutoComplete',
|
||||
extends: BaseAutoComplete,
|
||||
inheritAttrs: false,
|
||||
emits: ['update:modelValue', 'change', 'focus', 'blur', 'item-select', 'item-unselect', 'dropdown-click', 'clear', 'complete', 'before-show', 'before-hide', 'show', 'hide'],
|
||||
emits: ['update:modelValue', 'change', 'focus', 'blur', 'item-select', 'item-unselect', 'option-select', 'option-unselect', 'dropdown-click', 'clear', 'complete', 'before-show', 'before-hide', 'show', 'hide'],
|
||||
outsideClickListener: null,
|
||||
resizeListener: null,
|
||||
scrollHandler: null,
|
||||
|
@ -531,6 +531,7 @@ export default {
|
|||
}
|
||||
|
||||
this.$emit('item-select', { originalEvent: event, value: option });
|
||||
this.$emit('option-select', { originalEvent: event, value: option });
|
||||
|
||||
isHide && this.hide(true);
|
||||
},
|
||||
|
@ -662,6 +663,7 @@ export default {
|
|||
|
||||
this.$emit('update:modelValue', newValue);
|
||||
this.$emit('item-unselect', { originalEvent: event, value: removedValue });
|
||||
this.$emit('option-unselect', { originalEvent: event, value: removedValue });
|
||||
}
|
||||
|
||||
event.stopPropagation(); // To prevent onBackspaceKeyOnMultiple method
|
||||
|
@ -843,6 +845,7 @@ export default {
|
|||
|
||||
this.updateModel(event, value);
|
||||
this.$emit('item-unselect', { originalEvent: event, value: removedOption });
|
||||
this.$emit('option-unselect', { originalEvent: event, value: removedOption });
|
||||
this.dirty = true;
|
||||
DomHandler.focus(this.multiple ? this.$refs.focusInput : this.$refs.focusInput.$el);
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue