tldraw/tldraw

Disable drag-out-of-toolbar for pen inputs

Open

#7666 aperta il 10 gen 2026

Vedi su GitHub
 (3 commenti) (0 reazioni) (1 assegnatario)TypeScript (3212 fork)batch import
good first issuesdk

Metriche repository

Star
 (47.037 star)
Metriche merge PR
 (Merge medio 5g 4h) (227 PR mergiate in 30 g)

Descrizione

Problem

When using a pen/stylus to select tools in the toolbar, the drag-out-of-toolbar feature often triggers false positives. Small movements while tapping with a pen are interpreted as drag gestures, causing shapes to be created unintentionally. This creates a distracting experience when trying to simply select tools with a stylus.

Proposed solution

Disable the drag-out-of-toolbar functionality entirely for pen-type inputs (e.pointerType === 'pen'). The relevant code is in useDraggableEvents in TldrawUiMenuItem.tsx - it should check for pen input early and skip the drag handling path.

Why this makes sense

  • Pen users typically want precise control and are clicking to select tools, not drag
  • The existing drag threshold doesn't account for the slight movements inherent in pen input
  • Mouse and touch users can still benefit from drag-out-of-toolbar
  • This is a simple, targeted fix with no impact on other input types

Guida contributor