Skip to content

fix(bar-ui): add click suppression on buttons if bar was dragged - #24

Open
Xoppyc wants to merge 1 commit into
solidjs:mainfrom
Xoppyc:fix/toolbar-drag-click
Open

Xoppyc wants to merge 1 commit into
solidjs:mainfrom
Xoppyc:fix/toolbar-drag-click

Conversation

@Xoppyc

@Xoppyc Xoppyc commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Previously, dragging the toolbar by holding down on an IconButton would trigger a click event on that button upon release, unintentionally opening or toggling a panel.

  • Track drag distance (isDragging) with a 4px threshold so normal clicks still function immediately while intentional drags are distinguished.
  • Add a capture-phase click event listener on handle that calls stopPropagation() and preventDefault() if a drag just occurred, swallowing the event before it reaches the child buttons.

Notes

I used pnpm format and for some reason previously L15-L17 were expanded by the formatter

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.

1 participant