Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
iamstevendao committed Apr 25, 2024
2 parents fa87472 + 90fe32a commit a8fa6cd
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/components/vue-tel-input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
import { parsePhoneNumberFromString } from 'libphonenumber-js';
import { getDefault, setCaretPosition, getCountry, toLowerCase, toUpperCase } from '../utils';
import clickOutside from '../directives/click-outside';
import { computed, nextTick, onMounted, reactive, shallowRef, watch } from 'vue';
import { computed, nextTick, onMounted, reactive, shallowRef, watch, defineExpose } from 'vue';
const refRoot = shallowRef<HTMLDivElement>()
const refList = shallowRef<HTMLUListElement>()
Expand Down Expand Up @@ -557,9 +557,12 @@
function onSpace(e: KeyboardEvent) {
emit('space', e);
}
// function focus() {
// refInput.value?.focus();
// }
function focus() {
refInput.value?.focus();
}
function blur() {
refInput.value?.blur();
}
function toggleDropdown() {
if (props.disabled || props.dropdownOptions.disabled) {
return;
Expand Down Expand Up @@ -644,6 +647,10 @@
data.dropdownOpenDirection = 'above';
}
}
defineExpose({
focus,
blur,
})
</script>

<style src="../assets/sprite.css"></style>
Expand Down

0 comments on commit a8fa6cd

Please sign in to comment.