Skip to content

Commit

Permalink
fix(VSlider): update value before focusing thumb
Browse files Browse the repository at this point in the history
fixes #20912
  • Loading branch information
KaelWD authored and johnleider committed Jan 23, 2025
1 parent 2795792 commit c1fd4f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vuetify/src/components/VSlider/slider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useRtl } from '@/composables/locale'
import { makeRoundedProps } from '@/composables/rounded'

// Utilities
import { computed, provide, ref, shallowRef, toRef } from 'vue'
import { computed, nextTick, provide, ref, shallowRef, toRef } from 'vue'
import { clamp, createRange, getDecimals, propsFactory } from '@/util'

// Types
Expand Down Expand Up @@ -237,7 +237,6 @@ export const useSlider = ({

if (!activeThumbRef.value) return

activeThumbRef.value.focus()
mousePressed.value = true

if (activeThumbRef.value.contains(e.target as Node)) {
Expand All @@ -248,6 +247,7 @@ export const useSlider = ({
}

onSliderStart({ value: parseMouseMove(e) })
nextTick(() => activeThumbRef.value?.focus())
}

const moveListenerOptions = { passive: true, capture: true }
Expand Down

0 comments on commit c1fd4f7

Please # to comment.