Skip to content

Render user menu dropdown list items in <ul>

Scott de Jonge requested to merge 426745-nav-eval-replace-div-with-ul into master

What does this MR do and why?

GlDisclosureDropdown determines the root element based on slot contents, where if all slot contents are a list item or group the element will be <ul> otherwise <div> https://gitlab.com/gitlab-org/gitlab-ui/-/blob/main/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.vue#L228-233

In UserMenu the UserNameGroup component had GlDisclosureDropdownGroup as root element so the parent couldn't determine to use <ul>. Resolved by moving GlDisclosureDropdownGroup to UserMenu to render in <ul>.

Screenshots or screen recordings

Before After
CleanShot_2023-10-09_at_12.44.53_2x CleanShot_2023-10-09_at_12.43.32_2x

How to set up and validate locally

  1. Toggle user menu in new navigation
  2. Inspect dropdown markup
  3. Parent of <li> root items should be <ul>

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #426745 (closed)

Merge request reports

Loading