Skip to content

Commit

Permalink
Fixed bug wil emitted @input event for SelectField and SelectInput co…
Browse files Browse the repository at this point in the history
…mponents
  • Loading branch information
benjamindavid committed Jan 9, 2019
1 parent b70d14e commit 7904920
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/fields/SelectField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<p>{{ instructions }}</p>
</div>

<select-input :fullwidth="fullwidth" :options="options" :value="value" @input="$emit('input', $event.target.value)"></select-input>
<select-input :fullwidth="fullwidth" :options="options" :value="value" @input="$emit('input', $event)"></select-input>

<div class="invalid-feedback" v-for="(error, key) in errors" :key="key">
{{ error }}
Expand Down
2 changes: 1 addition & 1 deletion src/components/inputs/SelectInput.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div>
<div class="select">
<select :value="value" :class="{ 'w-full': fullwidth }" @input="$emit('input', $event)">
<select :value="value" :class="{ 'w-full': fullwidth }" @input="$emit('input', $event.target[$event.target.selectedIndex].value)">
<option v-for="(option, key) in options" :value="option.value" :key="key">{{ option.label }}</option>
</select>
</div>
Expand Down

0 comments on commit 7904920

Please sign in to comment.