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

Aperta
#6,768 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
15/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
css, javascript
Ambito
frontend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
PHP
Stelle
248
Fork
147
Merge medio
17m
PR unite (30g)
21

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di WoltLab/WCF

Tutte le issue di WoltLab/WCF

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.