Visitar URL original
USWDS - update data prop for consistency by ethangardner · Pull Request #6688 · uswds/uswds · GitHub
Skip to content

USWDS - update data prop for consistency - #6688

Merged
ethangardner merged 4 commits into
developfrom
feature/6687-data-prop-update
Jun 5, 2026
Merged

ethangardner merged 4 commits into
developfrom
feature/6687-data-prop-update

Conversation

@ethangardner

@ethangardner ethangardner commented Jun 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Standardized the in-page navigation component to use data-enhanced instead of data-created to match the convention established in other components, Rolled back a previous edit to the tooltip test while a decision is pending on how to handle tooltips in assistive tech.

Breaking change

This is not a breaking change. This change is purely internal to component initialization and does not affect any public APIs or user-facing behavior.

Related issue

Closes #6687

Preview link

Preview link: N/A

Problem statement

I was reviewing PR #6664 and planning on requesting these changes from the original submitter, but the PR was merged before I was able to submit my review. These changes address the comments I was going to leave.

Desired state: Component initialization guards should use consistent naming conventions across the codebase, making it easier for developers to understand and maintain the code.

Actual state: The in-page navigation component used data-created as its idempotency guard while other components (character count, date picker, file input, range) use data-enhanced. Additionally, aria-label was added to a file by a merged contribution, which may in conflict with USWDS

Consequences: Inconsistent naming conventions increase cognitive load for developers and make the codebase harder to navigate.

Solution

I changed the in-page navigation component's initialized check from dataset.created to dataset.enhanced. I left the a11y aria-label on the SVG with role="img" (which requires an accessible name per our CI checks) and removed aria-label from <a> and <span> elements where title already provides the accessible text.

Using data-enhanced aligns with the established pattern in other USWDS components that perform DOM enhancement (e.g. character-count, date-picker, file-input, range). This consistency makes it easier to search for enhancement logic across the codebase and understand component initialization patterns.

@ethangardner ethangardner linked an issue Jun 2, 2026 that may be closed by this pull request
@ethangardner
ethangardner marked this pull request as ready for review June 2, 2026 17:19
@ethangardner
ethangardner merged commit 2ca5009 into develop Jun 5, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from Triage to Fed Final Review in USWDS Core Project Data Jun 5, 2026
@annepetersen
annepetersen deleted the feature/6687-data-prop-update branch June 8, 2026 15:39
@chandracarney chandracarney moved this from Fed Final Review to Done in USWDS Core Project Data Jul 20, 2026
@ethangardner ethangardner added this to the uswds 3.14.0 - Aug 2026 milestone Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

Data prop update

3 participants