Skip to content

Commit 0b98d55

Browse files
authored
Merge pull request #7 from sj-av/input_event_feature
Update: Firing input event on change
2 parents c91fec9 + 8b457c8 commit 0b98d55

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/components/DadataSuggestions.vue

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
class="dadata-input"
55
type="text"
66
autocomplete="off"
7-
@change="$emit('change', model)"
7+
@change="onChange"
88
>
99
</template>
1010

@@ -134,6 +134,18 @@ export default {
134134
}
135135
this.$emit('input', this.model);
136136
},
137+
138+
onChange() {
139+
if (this.model === null || this.model === '') {
140+
this.$emit('update:fullInfo', null);
141+
}
142+
if (typeof this.model === 'string') {
143+
this.$emit('update:fullInfo', null);
144+
}
145+
this.$emit('input', this.model);
146+
this.$emit('change', this.model);
147+
},
148+
137149
},
138150
139151
destroyed() {

0 commit comments

Comments
 (0)