fix: use pointerdown+pointerType to block touch seeks on bottom bar
mousedown does not expose the input source — replaced with pointerdown which carries pointerType='touch', allowing noTouch=true to reliably skip touch input without affecting mouse/stylus on PC. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
162bf530a2
commit
47cf3d13e5
1 file changed
+5
-4
+5
-4
@@ -735,12 +735,13 @@ function _initBarScrub(bar, fill, onMove, noTouch = false) {
|
||||
_touchMoved = false;
|
||||
}, {passive:true});
|
||||
}
|
||||
bar.addEventListener('mousedown', e => {
|
||||
bar.addEventListener('pointerdown', e => {
|
||||
if (noTouch && e.pointerType === 'touch') return; // bottom bar: mouse/stylus only
|
||||
startScrub(getPos(e.clientX)); e.preventDefault();
|
||||
const mm = e2 => { if(S._scrubbing) moveScrub(getPos(e2.clientX)); };
|
||||
const mu = e2 => { if(S._scrubbing) endScrub(getPos(e2.clientX)); document.removeEventListener('mousemove',mm); document.removeEventListener('mouseup',mu); };
|
||||
document.addEventListener('mousemove', mm);
|
||||
document.addEventListener('mouseup', mu);
|
||||
const mu = e2 => { if(S._scrubbing) endScrub(getPos(e2.clientX)); document.removeEventListener('pointermove',mm); document.removeEventListener('pointerup',mu); };
|
||||
document.addEventListener('pointermove', mm);
|
||||
document.addEventListener('pointerup', mu);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user