Skip to content

Add drag-select to Multi dropdowns#128

Open
corradedied wants to merge 2 commits into
deividcomsono:mainfrom
corradedied:dropdown-dragging
Open

Add drag-select to Multi dropdowns#128
corradedied wants to merge 2 commits into
deividcomsono:mainfrom
corradedied:dropdown-dragging

Conversation

@corradedied

@corradedied corradedied commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Selecting many values in a long Multi dropdown (e.g. a player list) required clicking each item individually. Holding left click and dragging over items now selects or deselects them in one gesture.

Three upvalues (DragSelecting, DragSelectState, DragInputEndedConn) and a StopDragSelect helper are declared outside BuildDropdownList so they survive list rebuilds. BuildDropdownList calls StopDragSelect at the top to cancel any in-progress drag before destroying and recreating buttons.

For each non-disabled item in a Multi dropdown:

  • InputBegan (MB1) starts the drag, locks the toggle direction to the opposite of the pressed item's current state, applies it immediately, and attaches a UserInputService.InputEnded listener that fires callbacks once and clears drag state on mouse release.

  • MouseEnter extends the drag to each item the cursor passes over, applying the locked direction and respecting AllowNull.

  • MouseButton1Click returns early when DragSelecting is true to suppress the synthetic click Roblox fires after InputEnded, preventing the first item from being double-toggled.

Callbacks fire once at the end of the gesture rather than per item to avoid hammering Callback/Changed during a fast drag. Single-select dropdowns are unaffected.
ezgif-83fcfe3be54a0562

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