Skip to content

Commit

Permalink
fix: focus to input
Browse files Browse the repository at this point in the history
fixes: #136
  • Loading branch information
talkhabi committed Jan 30, 2021
1 parent de15814 commit 10bf5fd
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/picker/VuePersianDatetimePicker.vue
Expand Up @@ -23,6 +23,7 @@
</label>
<input
:id="id"
ref="input"
type="text"
:name="name"
:class="[inputClass, { 'vpd-is-editable': editable }]"
Expand Down Expand Up @@ -1531,10 +1532,14 @@ export default {
return d
},
focus(e) {
if (!this.editable) {
e.preventDefault()
e.stopPropagation()
e.target.blur()
if (this.editable) {
if (this.$refs.input) this.$refs.input.focus()
} else {
if (e) {
e.preventDefault()
e.stopPropagation()
e.target.blur()
}
this.visible = true
return false
}
Expand Down

0 comments on commit 10bf5fd

Please sign in to comment.