Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,12 @@ export function Draggable({
}

return (
<div {...props} {...drag} ref={ref}>
<div
{...props}
{...drag}
ref={ref}
style={{ touchAction: 'none', ...props.style }}
>
{children}
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,21 @@ describe('devtools-position-default', () => {
expect(style).toContain('bottom: 20px')
expect(style).toContain('left: 20px')
})

it('should disable browser touch gestures on the draggable indicator', async () => {
const browser = await next.browser('/')
await getDevIndicatorPosition(browser)

const touchAction = await browser.eval(() => {
const portal = Array.from(
document.querySelectorAll('nextjs-portal')
).find((p) => p.shadowRoot?.querySelector('[data-nextjs-toast]'))
const indicator = portal?.shadowRoot?.querySelector('[data-nextjs-toast]')
const draggable = indicator?.firstElementChild

return draggable ? getComputedStyle(draggable).touchAction : null
})

expect(touchAction).toBe('none')
})
})
Loading