Skip to content

Commit 41c1ba4

Browse files
committed
Fix value not being reset
1 parent a1086a2 commit 41c1ba4

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

resources/js/components/FieldCombinator.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<div class="flex mb-2 space-x-2 items-start border-rounded bg-gray-100 p-2 handle">
2929
<div>{{ index + 1 }}</div>
3030

31-
<SelectControl @change="(value) => columns[index].name = value" :selected="columns[index].name">
31+
<SelectControl @change="(value) => changeField(index, value)" :selected="columns[index].name">
3232
<option value="">- Select field -</option>
3333

3434
<optgroup label="Imported column">
@@ -161,6 +161,15 @@ export default {
161161
columns: this.columns,
162162
separator: this.rawSeparator,
163163
});
164+
},
165+
166+
changeField(index, value) {
167+
this.columns[index].name = value;
168+
169+
// Reset 'value' when needed
170+
if (value !== 'custom') {
171+
this.columns[index].value = '';
172+
}
164173
}
165174
}
166175
}

0 commit comments

Comments
 (0)