Skip to content

UX/A11y: Replace empty href=# attributes with valid actions#3896

Open
pradeep0153 wants to merge 1 commit into
Premshaw23:masterfrom
pradeep0153:fix/issue-3894-empty-href
Open

UX/A11y: Replace empty href=# attributes with valid actions#3896
pradeep0153 wants to merge 1 commit into
Premshaw23:masterfrom
pradeep0153:fix/issue-3894-empty-href

Conversation

@pradeep0153

Copy link
Copy Markdown
Contributor

Closes #3894.

Description

This PR resolves a frustrating User Experience (UX) flaw where interacting with certain visual links caused the browser to aggressively snap to the top of the webpage.

Changes Made

  • Scanned the React components for anchor tags (<a>) utilizing an empty hash fragment (href="#") that were intended to trigger JavaScript events rather than perform navigation.
  • Replaced these attributes with href="javascript:void(0)" (or refactored them to <button type="button">) to neutralize the default anchor behavior while completely preserving the element's stylings and interactivity.

Impact

  • Seamless UX & Accessibility: Users can now click on support links, toggles, or empty interactive anchors without losing their scroll position on the page, resulting in a much smoother and less disorienting browsing experience.

@AllCodeBreaker

Copy link
Copy Markdown

@pradeep0153 Your PR doesn't have any code changes, so I'm unable to review it. Could you please check and update it?

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.

UX/A11y: Replace empty href="#" attributes with valid actions

2 participants