Skip to content

Commit 1113ab9

Browse files
committed
Added focus event for select
1 parent 616e5f0 commit 1113ab9

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

components/Search/index.vue

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
}">
2222
<select
2323
ref="provinces"
24+
@focus="onFocus"
2425
@change="onChange">
2526
<option
2627
label="Select State"
@@ -173,9 +174,24 @@ export default {
173174
})
174175
175176
},
177+
onFocus(e) {
178+
if (e.target.value) {
179+
this.locationId = e.target.value
180+
this.$gtag('event', 'focus', {
181+
event_category: 'province',
182+
event_label: 'province focus',
183+
value: this.locationId
184+
})
185+
}
186+
},
176187
onChange(e) {
177188
this.locationId = e.target.value
178189
this.$refs.search.focus()
190+
this.$gtag('event', 'change', {
191+
event_category: 'province',
192+
event_label: 'province change',
193+
value: this.locationId
194+
})
179195
}
180196
}
181197
}

0 commit comments

Comments
 (0)