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

Đang mở
#6,768 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
15/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
css, javascript
Lĩnh vực
frontend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.
Ngôn ngữ chính
PHP
Star
248
Fork
147
Merge trung bình
17 phút
Pull request đã merge (30 ngày)
21

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của WoltLab/WCF

Tất cả issue của WoltLab/WCF

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.