Skip to content

refactor(a11y): logged-in dropdown as button not link#1256

Open
wesleyboar wants to merge 7 commits intoTACC:mainfrom
wesleyboar:cursor/tup-ui-changes-port-6eca
Open

refactor(a11y): logged-in dropdown as button not link#1256
wesleyboar wants to merge 7 commits intoTACC:mainfrom
wesleyboar:cursor/tup-ui-changes-port-6eca

Conversation

@wesleyboar
Copy link
Copy Markdown
Member

@wesleyboar wesleyboar commented Mar 24, 2026

Overview

Use <button> (not <a>) for logged-in dropdown in portal nav.

Important

Requires Core-CMS v4.38.6 or greater1.

Related

Changes

In nav_portal.raw.html, changes the authenticated user dropdown toggle from <a href="#" role="button"> to <button type="button">, which is semantically correct since the element triggers an action (opens a dropdown) rather than navigating anywhere.

Testing

  1. Log in to the portal.
  2. Confirm the username dropdown in the nav bar:
    1. Renders the same as it had before.
    2. Opens and closes correctly via mouse click.
    3. Opens and closes correctly via keyboard navigation.
      Tab navigates to dropdown. Enter opens it. Enter/Esc closes it.

Footnotes

  1. Core-CMS v4.38.6 loads Core-Styles v2.53.3 which loads TACC/Core-Styles#599 which styles <button> and <a> the same in this context.

Change the authenticated user dropdown toggle from an anchor element
to a button element, which is semantically correct since it triggers
an action (opens a dropdown) rather than navigating to a URL.

- Remove href="#" and role="button"
- Add type="button"
- Change closing </a> to </button>

Port of TACC/tup-ui#537 commit 4b63942 (with fix from b3a6487
applied inline, avoiding that intermediate invalid-HTML state).

Co-authored-by: Wesley B <wesleyboar@users.noreply.github.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.86%. Comparing base (74f4b1c) to head (b8a37ad).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1256   +/-   ##
=======================================
  Coverage   63.86%   63.86%           
=======================================
  Files         451      451           
  Lines       13481    13481           
  Branches     2658     2663    +5     
=======================================
  Hits         8610     8610           
  Misses       4532     4532           
  Partials      339      339           
Flag Coverage Δ
javascript 66.88% <ø> (ø)
unittests 60.68% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@wesleyboar wesleyboar changed the title refactor: logged-in dropdown as button not link refactor(a11y): logged-in dropdown as button not link Mar 24, 2026
@wesleyboar wesleyboar marked this pull request as ready for review March 24, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants