Vuetify: [Bug Report] Time picker in dialog defaults to selecting minutes after first time opened

Created on 5 Jul 2018  路  5Comments  路  Source: vuetifyjs/vuetify

Versions and Environment

Vuetify: 1.1.1
Vue: 2.5.2
Browsers: Chrome 67.0.3396.99
OS: Windows 10

Steps to reproduce

  1. Click on time field to open dialog.
  2. Select hours and minutes.
  3. Close dialog.
  4. Click on time field again.

Expected Behavior

The time picker should always default to selecting hours when opened in a dialog or menu. Perhaps, when the dialog is closed, the picker should reset selectingHour to true.

Actual Behavior

Opening a time picker in a dialog or menu for the first time shows hours. When I re-open the dialog, it always shows minutes until I specifically click on hours.

Reproduction Link

https://codepen.io/anon/pen/aKgzzm?editors=1010#0

Other comments

Likely related to the issue from PR 4198.

VTimePicker enhancement help wanted

Most helpful comment

Workaround 2:

https://codepen.io/anon/pen/VBoqaB?editors=1000

Requires ref for v-time-picker but preserves closing animation

All 5 comments

Slight correction. It's not that it always shows minutes after the first time, it's simply that it remembers the last used type.

Workaround: use <v-time-picker v-if="menu/dialog model">

https://codepen.io/anon/pen/gKNqQa?editors=1010#0

Workaround 2:

https://codepen.io/anon/pen/VBoqaB?editors=1000

Requires ref for v-time-picker but preserves closing animation

Needs keep-content-alive prop to be implemented (see #4518)

Looks like this bug is a "reimplementation" of #1549

Can't we just set this.selecting = selectingTimes.hour as I've done in e8bac4e?
Maybe put it in onChange () like this:

onChange () {
  if (this.selecting === selectingTimes.hour) {
    this.selecting = selectingTimes.minute
  } else if (this.useSeconds && this.selecting === selectingTimes.minute) {
    this.selecting = selectingTimes.second
  } else {
    this.selecting = selectingTimes.hours  // <-- here it goes?
  }
  // ...
}

I can't test this right now but maybe tomorrow

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alterhu2020 picture alterhu2020  路  3Comments

itanka9 picture itanka9  路  3Comments

paladin2005 picture paladin2005  路  3Comments

KuroThing picture KuroThing  路  3Comments

smousa picture smousa  路  3Comments