Skip to content

Commit 0ad792d

Browse files
committed
fix(mobile): enable swiping from content
1 parent 4f303e2 commit 0ad792d

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

e2e/vue.spec.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,29 +167,31 @@ test('moves the mobile camera with a touch pointer without horizontal overflow',
167167
throw new Error('Surface camera is not visible')
168168
}
169169

170+
const title = page.locator('h1')
171+
170172
await camera.evaluate((element) => {
171173
element.setPointerCapture = () => undefined
172174
element.hasPointerCapture = () => false
173175
})
174176
const y = box.y + 160
175177
const startX = box.x + 280
176-
await camera.dispatchEvent('pointerdown', {
178+
await title.dispatchEvent('pointerdown', {
177179
button: 0,
178180
clientX: startX,
179181
clientY: y,
180182
isPrimary: true,
181183
pointerId: 1,
182184
pointerType: 'touch',
183185
})
184-
await camera.dispatchEvent('pointermove', {
186+
await title.dispatchEvent('pointermove', {
185187
button: 0,
186188
clientX: startX - 150,
187189
clientY: y,
188190
isPrimary: true,
189191
pointerId: 1,
190192
pointerType: 'touch',
191193
})
192-
await camera.dispatchEvent('pointerup', {
194+
await title.dispatchEvent('pointerup', {
193195
button: 0,
194196
clientX: startX - 150,
195197
clientY: y,

src/App.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,10 @@ function canPanFrom(event: PointerEvent) {
404404
return true
405405
}
406406
407+
if (event.pointerType === 'touch') {
408+
return !target.closest('a, button, input, textarea, select, [contenteditable]')
409+
}
410+
407411
return !target.closest(
408412
'a, button, input, textarea, select, [contenteditable], p, h1, h2, h3, h4, h5, h6, li, code, pre, span',
409413
)

0 commit comments

Comments
 (0)