Skip to content

Commit

Permalink
fix(components): input select not emitting change event
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuagraber committed Nov 23, 2024
1 parent 2a07819 commit cf22d55
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/InputSelect/PdapInputSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ const { name, options, id, label, combobox, filter } = withDefaults(
},
}
);
const emit = defineEmits(['change']);
const slots = useSlots();
if (!slots.label && !label)
throw new Error(
Expand Down Expand Up @@ -239,6 +240,9 @@ watch(
(newSelected) => {
// Update form values when state changes.
if (newSelected) {
emit('change', newSelected);
const event = new Event('input', { bubbles: true, cancelable: true });
selectRef.value.dispatchEvent(event);
setValues({ [name]: newSelected.value });
}
}
Expand Down

0 comments on commit cf22d55

Please # to comment.