Skip to content

fix(dev-overlay): add touch drag support for dev indicator (#96634) - #97044

Open
arts009009009 wants to merge 8 commits into
vercel:canaryfrom
arts009009009:fix/dev-indicator-touch-drag
Open

fix(dev-overlay): add touch drag support for dev indicator (#96634)#97044
arts009009009 wants to merge 8 commits into
vercel:canaryfrom
arts009009009:fix/dev-indicator-touch-drag

Conversation

@arts009009009

Copy link
Copy Markdown

Summary

This PR fixes the issue where the DevTools indicator in the error overlay could not be dragged properly on touch devices. The draggable component was freezing when attempting to move it via touch input.

Changes

  • Updated draggable.tsx to handle touch events alongside mouse events.
  • Added proper event listeners for touchstart, touchmove, and touchend.
  • Ensured smooth drag behavior without freezing or blocking scroll.

Reproduction

  1. Run Next.js in dev mode.
  2. Open the DevTools error overlay.
  3. Attempt to drag the indicator on a touch device (or simulate touch in Chrome DevTools).
  4. Before: indicator freezes and cannot be moved.
  5. After: indicator moves smoothly with touch drag.

Notes

  • Scoped to a single file: packages/next/src/next-devtools/dev-overlay/components/errors/dev-tools-indicator/draggable.tsx.
  • Passes lint and style checks.
  • No runtime logic affected outside of the draggable component.

Closes #96634

arts009009009 and others added 5 commits August 9, 2026 18:15
…ure cancellation

Add back `touchAction: 'none'` to the Draggable wrapper to prevent touch
gestures from being treated as viewport panning, which cancelled the drag
and left the devtools indicator in a broken stuck state.

Handle the `pointercancel` event so that when a drag gesture is cancelled
(by the browser or OS), the indicator gracefully animates back to its
previous corner instead of remaining stuck.

Guard `releasePointerCapture` with `hasPointerCapture` to avoid errors
when the pointer capture was already released by the browser.

Adds a regression test verifying that `touchAction` is set to `'none'`
on the draggable wrapper element.

Fixes vercel#96634
type: 'string',
},
{
type: 'object',

@vercel vercel Bot Aug 10, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rewriting the no-html-link-for-pages options schema to an object-only shape breaks all existing configs that pass the custom pages directory as a string or array of strings, causing ESLint to throw a schema-validation error.

Fix on Vercel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dev indicator dragging makes it stuck when using touch

1 participant