-
Notifications
You must be signed in to change notification settings - Fork 216
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(action-button): remove proxy click in capture phase #5204
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 4de265f The changes in this PR will be included in the next version bump. This PR includes changesets to release 84 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Branch previewReview the following VRT differencesWhen a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:
If the changes are expected, update the |
Tachometer resultsCurrently, no packages are changed by this PR... |
Pull Request Test Coverage Report for Build 13916224974Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
@@ -105,8 +105,6 @@ export class ButtonBase extends ObserveSlotText(LikeAnchor(Focusable), '', [ | |||
private shouldProxyClick(): boolean { | |||
let handled = false; | |||
if (this.anchorElement) { | |||
// click HTML anchor element by proxy | |||
this.anchorElement.click(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Rajdeepc this is breaking the ink in voiceover. To replicate:
- Using VoiceOver, go to the example with an HREF in the docs.
- Once focus is on the button, voice over will instruct you to use CTRL+Option+Space to click the link.
- Nothing happens.
I think removing the proxy Click is absolutely the right direction, but we may need to look at delegating focus of the component to the link or button rendered within the component before removing the proxy.
And since all components that extend focusable and like anchor are built upon the the current pattern there may be some additional refactoring. (I have a JIRA ticket SWC-598 about exploring button refactor if you'd like to know more.)
Description
Removed
shouldProxyClick
as the events will be bubbled up in the capture phase. This overhead was adding additional click for href elements causing double clicks to get registered.Related issue(s)
Motivation and context
How has this been tested?
Test case 1
Test case 2
Did it pass in Desktop?
Did it pass in Mobile?
Did it pass in iPad?
Screenshots (if appropriate)
Types of changes
Checklist
Best practices
This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against
main
.