Modernize the dropdown implementation (`Ui/Dropdown/Simple`)

Open
#6,768 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
15/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
css, javascript
Domain
frontend

Research direction

This is a design proposal, not a single task. Start with the existing Ui/Dropdown/Simple module and its dependencies named in the issue, Ui/Alignment and UiCloseOverlay, to see how the current dropdowns open, position and close. Done would mean agreeing on the target design (Popover API, anchor positioning, instance-based options, ARIA semantics) with maintainers, then splitting it into smaller issues. A newcomer would be better off picking one of those smaller pieces.

Written by the indexing model from the issue text.

Description

Rebuild dropdowns on native platform features and keep a compatibility layer for existing markup and API consumers.

  1. Popover API (popover="auto"): native top layer, light dismiss, Escape handling, and only one open popover at a time. This removes the global menu container, the z-index workarounds and most of the UiCloseOverlay integration.
  2. CSS anchor positioning (anchor-name, position-anchor, position-try-fallbacks): the browser handles placement and flipping. This replaces the scroll/resize/dialog-scroll recalculation and probably the iOS virtual-keyboard hack. Fall back to Ui/Alignment where it isn't supported.
  3. Instance-based implementation: one object per dropdown that owns its toggle, menu, options and callbacks. Typed options replace the data-* flags, which stay readable only for BC.
  4. Correct semantics by content type:
  • Action menus use menu/menuitem on the interactive elements, with roving tabindex, Arrow/Home/End navigation, and Space and Enter working.
  • Other content follows the disclosure pattern (aria-expanded + aria-controls) with normal tab order and no forced roles.
  1. Toggle markup: require toggles in new code and stop patching roles onto arbitrary elements.
  2. CSS fixes: overscroll-behavior: contain replaces the wheel handler, and scrollIntoView({ block: "nearest" }) replaces the manual scroll-to-active math.
Dominant language
PHP
Stars
248
Forks
147
Avg merge
17m
Merged PRs (30d)
21

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from WoltLab/WCF

All issues in WoltLab/WCF

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.