Skip to content

Commit

Permalink
fix(select): emit input & change events when option is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-solanki committed Feb 2, 2023
1 parent d8efaa5 commit 49eb1ba
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/anu-vue/src/components/select/ASelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ const props = defineProps(defu({
}, baseInputProps))
const emit = defineEmits<{
// (e: 'input', value: (ExtractPropTypes<typeof props>)['modelValue']): void
(e: 'change', value: (ExtractPropTypes<typeof props>)['modelValue']): void
(e: 'input', value: (ExtractPropTypes<typeof props>)['modelValue']): void
(e: 'update:modelValue', value: (ExtractPropTypes<typeof props>)['modelValue']): void
}>()
Expand Down Expand Up @@ -108,8 +108,8 @@ const optionClasses = 'a-select-option states before:transition-none cursor-poin
const handleOptionClick = (option: SelectOption) => {
const value = isObjectOption(option) && !props.emitObject ? (option as ObjectOption).value : option
// Do we really need this emit? 🤔 => I guess no because now on all events get attached to input
// emit('input', value)
emit('change', value)
emit('input', value)
emit('update:modelValue', value)
}
const closeOptions = (event: MouseEvent) => {
Expand Down

0 comments on commit 49eb1ba

Please sign in to comment.