WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

text input loose focus on v12.1.0 #1224

@abdouthetif

Description

@abdouthetif

Describe the bug
Text input with selectOnFocus set to true loose input focus after first click in v12.1.0. This is a regression from version 12.0.5 where the same code works correctly.

To Reproduce
Steps to reproduce the behavior:

  1. Use VueDatePicker with selectOnFocus option set to true
  2. Click on text input
  3. Input looses focus (you have to click another time on the input)
<template>
  <div class="mx-auto max-w-screen-xl px-4">
    <div class="w-full mb-5 mt-20">
      <div>Vue Datepicker v12.0.5</div>
      <div class="mt-2">
        <VueDatePicker
          v-model="date"
          model-type="yyyy-MM-dd"
          :text-input="{ selectOnFocus: true }"
          :formats="{ input: 'dd/MM/yyyy' }"
          :auto-apply="true"
          :flow="{ steps: ['year', 'month', 'calendar'], partial: true }"
        />
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue';
import { VueDatePicker } from '@vuepic/vue-datepicker';
import '@vuepic/vue-datepicker/dist/main.css';

const date = ref();
</script>

Expected behavior
When you click on the input you should be able to type the date without the need to click another time on the input.

Stackblitz Links
v12.0.5 (Working): https://stackblitz.com/edit/github-bgfv7iv5-vwkgychj?file=src%2Fviews%2FHome.vue
v12.1.0 (Broken): https://stackblitz.com/edit/github-bgfv7iv5-vy2uczsj?file=src%2Fviews%2FHome.vue

Video

Capture.video.du.2025-12-10.15-58-49.webm

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting triageThe issue is not reviewed by the maintainersbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions