Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Button accessibility #7420

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

canerakdas
Copy link
Member

Description

In the Button component, the native event listener provided by the browser for anchors is modified, so in some cases it does not work as it should

For example, the download button on the home page with a tab and press enter does not start the download

With this PR, I changed the current approach a little bit so that if there is a href in the props, the button acts like an anchor, and if there is no href, it acts like a button

Validation

The places where the Button component is used in the preview must be accessible

Related Issues

related to #7390, #7287, #7247

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run npm run format to ensure the code follows the style guide.
  • I have run npm run test to check if all tests are passing.
  • I have run npx turbo build to check if the website builds without errors.
  • I've covered new added functionality with unit tests if necessary.

@canerakdas canerakdas requested a review from a team as a code owner January 24, 2025 11:43
Copy link

vercel bot commented Jan 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview Jan 24, 2025 11:44am

Copy link
Member

@AugustinMauroy AugustinMauroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGMT ! Maybe add more unit test

@bmuenzenmeyer
Copy link
Collaborator

Maybe add more unit test

yeah this PR had me hunting for why we changed it recently in the first place. making sure we are not ping-ponging use cases in a shared component is important

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