Skip to content

Commit 3407748

Browse files
authored
Merge pull request #158 from niccord/master
Add `focus` event. Fix #149
2 parents 9cb51b7 + 4a27f6c commit 3407748

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ Read more on `vue-form-generator`'s [instruction page](https://icebob.gitbooks.i
189189
| `input` | `String`, `Object` | Fires when the input changes with the argument is the object includes `{ number, isValid, country }` | `onInput` deprecated |
190190
| `validate` | `Object` | Fires when the correctness of the phone number changes (from `true` to `false` or vice-versa) and when the component is mounted `{ number, isValid, country }` | `onValidate` deprecated |
191191
| `blur` | | Fires on blur event | `onBlur` deprecated |
192+
| `focus` | | Fires on focus event | |
192193
| `space` | | Fires on keyup.space event | `onSpace` deprecated |
193194
| `enter` | | Fires on keyup.enter event | `onEnter` deprecated |
194195
| `open` | | Fires when the flags dropdown opens | |

src/components/vue-tel-input.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
:maxlength="maxLen"
4949
:tabindex="inputOptions && inputOptions.tabindex ? inputOptions.tabindex : 0"
5050
@blur="onBlur"
51+
@focus="onFocus"
5152
@input="onInput"
5253
@keyup.enter="onEnter"
5354
@keyup.space="onSpace"
@@ -498,6 +499,9 @@ export default {
498499
this.$emit('blur');
499500
this.$emit('onBlur'); // Deprecated
500501
},
502+
onFocus() {
503+
this.$emit('focus');
504+
},
501505
onEnter() {
502506
this.$emit('enter');
503507
this.$emit('onEnter'); // Deprecated

0 commit comments

Comments
 (0)