Skip to content

feat(VTimePicker): Add keyboard controls#22604

Open
ikushum wants to merge 10 commits into
devfrom
fix/time-picker-accessibility-improvement
Open

feat(VTimePicker): Add keyboard controls#22604
ikushum wants to merge 10 commits into
devfrom
fix/time-picker-accessibility-improvement

Conversation

@ikushum
Copy link
Copy Markdown
Member

@ikushum ikushum commented Feb 7, 2026

fixes #10722, #21885

Description

  • Convert the hour, second and minute divs to buttons
  • Add keyboard controls and navigation

Markup:

<template>
  <v-container>
    <v-time-picker
      v-model="model"
      use-seconds
    />
  </v-container>
</template>

<script setup>
  import { ref } from 'vue'

  const model = ref()
</script>

@ikushum ikushum self-assigned this Feb 7, 2026
@J-Sek
Copy link
Copy Markdown
Contributor

J-Sek commented Feb 8, 2026

The immediate problem becomes - assistive tools will show the clock has 12 options for minutes and seconds with gaps. Not sure if VBtn approach is correct here. Maybe the clock should have role spinbutton and accept up/down keys to change, while the visual representation is more of a guide for people relying on pointer-based interaction.

@ikushum ikushum force-pushed the fix/time-picker-accessibility-improvement branch from 6d568d8 to 667b82d Compare February 9, 2026 04:31
@ikushum ikushum marked this pull request as ready for review February 9, 2026 04:51
@ikushum ikushum requested a review from a team February 9, 2026 04:51
Comment thread packages/vuetify/src/components/VTimePicker/VTimePickerClock.sass Outdated
Comment thread packages/vuetify/src/components/VTimePicker/VTimePickerClock.tsx
@J-Sek
Copy link
Copy Markdown
Contributor

J-Sek commented Feb 26, 2026

The claim "because tests look ugly" is too weak to justify the risk unintentional styling accidents. E.g. user can make all VBtn have strong shadow and even supplement custom CSS, just to later realize it leaks into this component.

Everything else looks good and we could merge without VBtn.

@J-Sek J-Sek force-pushed the dev branch 2 times, most recently from 5b257fd to 86800d9 Compare March 29, 2026 00:37
@ikushum
Copy link
Copy Markdown
Member Author

ikushum commented May 16, 2026

The claim "because tests look ugly" is too weak to justify the risk unintentional styling accidents. E.g. user can make all VBtn have strong shadow and even supplement custom CSS, just to later realize it leaks into this component.

Everything else looks good and we could merge without VBtn.

@J-Sek Looks like all the v-btn issues you are explaining are not relevant anymore because this VBtn now has _as="VTimePickerClockBtn". Global defaults set to VBtn won't impact the clock buttons.

Let me know if I'm wrong

@ikushum ikushum requested a review from J-Sek May 16, 2026 07:34
@J-Sek
Copy link
Copy Markdown
Contributor

J-Sek commented May 16, 2026

@ikushum, thanks for the answer. I think I had CSS and Sass variables in mind - e.g. solid "brutalist" shadow is easier to pull off with custom CSS.

And I did not notice we have added !importants as well. It is a bit backwards after cleanup we did to support CSS @layers.

Also, when both parts are visible (inputs and the clock), the interaction feels a bit weird... I mean, the user [Tab]s over to reach the clock, but can only change the last segment (minutes or seconds). Theoretically we could re-assign left/right arrows to toggle hours/minutes/seconds. Sorry for not bringing it in the very first feedback batch. Fixed it in last commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants