Skip to content

Add scrollbar support to UIDropdown#2833

Open
benjamin-kirkbride wants to merge 3 commits intodevelopmentfrom
feature/dropdown-scrollbar
Open

Add scrollbar support to UIDropdown#2833
benjamin-kirkbride wants to merge 3 commits intodevelopmentfrom
feature/dropdown-scrollbar

Conversation

@benjamin-kirkbride
Copy link
Collaborator

@benjamin-kirkbride benjamin-kirkbride commented Mar 8, 2026

Summary

  • Wraps dropdown menu options in a UIScrollArea + UIScrollBar, preventing the menu from overflowing the window when there are many options
  • Adds a max_height parameter (default 200px) to UIDropdown to control when scrolling activates
  • Options are now managed via _options_layout inside the scroll area, with add_option() and clear_options() methods on the overlay

Test plan

  • Open dropdown with many options (e.g., 20+) and verify the menu is capped at max_height with a functional scrollbar
  • Verify mouse wheel scrolling works within the dropdown menu
  • Verify clicking an option still selects it and closes the dropdown
  • Verify clicking outside the dropdown still closes it
  • Test with few options (e.g., 3) to confirm no unnecessary scrolling
  • Test with custom max_height values
  • Test with dividers in the options list

🤖 Generated with Claude Code

The dropdown menu now wraps options in a UIScrollArea with a UIScrollBar,
preventing the menu from extending beyond the window when there are many
options. A new max_height parameter (default 200px) controls when
scrolling activates.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@benjamin-kirkbride benjamin-kirkbride marked this pull request as draft March 8, 2026 21:07
The UIManager was overriding the overlay rect set by UIDropdown.do_layout
because size_hint=(0, 0) caused it to be resized to 0x0. Using
size_hint=None prevents the UIManager from touching the size.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@benjamin-kirkbride benjamin-kirkbride marked this pull request as ready for review March 8, 2026 21:38
@benjamin-kirkbride benjamin-kirkbride added the gui Related to arcade GUI (sub module arcade.gui) label Mar 8, 2026
- Add invert_scroll, scroll_speed, show_scroll_bar parameters to UIDropdown
- Add 12 integration tests covering the full PR test plan
- Update CHANGELOG, tutorial docs, and examples with scroll features
- Examples now use many options to demonstrate scrolling

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gui Related to arcade GUI (sub module arcade.gui)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant