Skip to content

[Proposal] Improve the dropdown step by step #23345

Closed
@wxiaoguang

Description

@wxiaoguang

The Problem

Gitea uses Fomantic UI Dropdown heavily, but the dropdown has many unfixable problems and already causes a lot of bugs for a11y.

The root problem is that Fomantic Dropdown was designed to be used for many different purposes (as much as possible ...)

  • Menu (the profile menu in navbar, the language menu in footer)
  • Popup (the branch/tag panel, the review box)
  • Simple <select> , used in many forms
  • Searchable option-list with static items (used in many forms)
  • Searchable option-list with dynamic items (ajax)
  • Searchable multiple selection option-list with dynamic items: the repo topic setting
  • More complex usages, like the Issue Label selector

And Fomantic Dropdown requires that the focus must be on its primary element, see aria.md. If the focus changes, it hides or panics. If we treat the dropdown as a single element, the focusing behavior is fine, but if the dropdown is used for complex interaction, it would cause problems.

Before: aria.js could fix many a11y related problems and it even works with screen readers. However, the ending time of that hacky patch comes sooner or later.

Some following fixes:

The Future

  • Use native <select> as much as possible
  • Re-use the Fomantic Dropdown styles but rewrite the code for different purposes one by one.
  • Choose other components to replace Fomantic Dropdown.
  • (TODO)

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/featureCompletely new functionality. Can only be merged if feature freeze is not active.type/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions