fix: select scorll in mobile (#3707)
parent
006e23ab69
commit
7303e9ae86
|
@ -1,5 +1,5 @@
|
||||||
import supportsPassive from '../../_util/supportsPassive';
|
import supportsPassive from '../../_util/supportsPassive';
|
||||||
import { watch, Ref } from 'vue';
|
import { watch, Ref, onMounted } from 'vue';
|
||||||
|
|
||||||
const SMOOTH_PTG = 14 / 15;
|
const SMOOTH_PTG = 14 / 15;
|
||||||
|
|
||||||
|
@ -80,28 +80,34 @@ export default function useMobileTouchMove(
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
watch(inVirtual, val => {
|
onMounted(() => {
|
||||||
listRef.value.removeEventListener(
|
watch(
|
||||||
'touchstart',
|
inVirtual,
|
||||||
onTouchStart,
|
val => {
|
||||||
supportsPassive
|
listRef.value.removeEventListener(
|
||||||
? ({
|
'touchstart',
|
||||||
passive: false,
|
onTouchStart,
|
||||||
} as EventListenerOptions)
|
supportsPassive
|
||||||
: false,
|
? ({
|
||||||
|
passive: false,
|
||||||
|
} as EventListenerOptions)
|
||||||
|
: false,
|
||||||
|
);
|
||||||
|
cleanUpEvents();
|
||||||
|
clearInterval(interval);
|
||||||
|
if (val) {
|
||||||
|
listRef.value.addEventListener(
|
||||||
|
'touchstart',
|
||||||
|
onTouchStart,
|
||||||
|
supportsPassive
|
||||||
|
? ({
|
||||||
|
passive: false,
|
||||||
|
} as EventListenerOptions)
|
||||||
|
: false,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true },
|
||||||
);
|
);
|
||||||
cleanUpEvents();
|
|
||||||
clearInterval(interval);
|
|
||||||
if (val) {
|
|
||||||
listRef.value.addEventListener(
|
|
||||||
'touchstart',
|
|
||||||
onTouchStart,
|
|
||||||
supportsPassive
|
|
||||||
? ({
|
|
||||||
passive: false,
|
|
||||||
} as EventListenerOptions)
|
|
||||||
: false,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue