Skip to content

Commit

Permalink
feat(VPullToRefresh): add disabled prop
Browse files Browse the repository at this point in the history
fixes #20242
  • Loading branch information
yuwu9145 committed Jul 31, 2024
1 parent 306a262 commit 79cc227
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/vuetify/src/labs/VPullToRefresh/VPullToRefresh.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const VPullToRefresh = genericComponent<VPullToRefreshSlots>()({
name: 'VPullToRefresh',

props: {
disabled: Boolean,
pullDownThreshold: {
type: Number,
default: 64,
Expand All @@ -47,13 +48,13 @@ export const VPullToRefresh = genericComponent<VPullToRefreshSlots>()({
const topOffset = computed(() => clamp(touchDiff.value, 0, props.pullDownThreshold))

function onTouchstart (e: TouchEvent | MouseEvent) {
if (refreshing.value) return
if (refreshing.value || props.disabled) return
touching.value = true
touchstartY = 'clientY' in e ? e.clientY : e.touches[0].clientY
}

function onTouchmove (e: TouchEvent | MouseEvent) {
if (refreshing.value || !touching.value) return
if (refreshing.value || !touching.value || props.disabled) return

const touchY = 'clientY' in e ? e.clientY : e.touches[0].clientY

Expand All @@ -63,7 +64,7 @@ export const VPullToRefresh = genericComponent<VPullToRefreshSlots>()({
}

function onTouchend (e: TouchEvent | MouseEvent) {
if (refreshing.value) return
if (refreshing.value || props.disabled) return
touching.value = false
if (canRefresh.value) {
function done () {
Expand Down

0 comments on commit 79cc227

Please # to comment.