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(cdk/a11y): detect fake touchstart events from screen readers #21987

Merged
merged 1 commit into from Feb 25, 2021

Conversation

crisbeto
Copy link
Member

We currently have handling for the case where a mousedown event is thrown off by a fake mousedown listener that may be dispatched by a screen reader when an element is activated. It turns out that if the device has touch support, screen readers may dispatch a fake touchstart event instead of a fake mousedown.

These changes add another utility function that allows us to distinguish the fake events and fix some issues where keyboard focus wasn't being shown because of the fake touchstart events.

Fixes #21947.

@crisbeto crisbeto added P2 The issue is important to a large percentage of users, with a workaround Accessibility This issue is related to accessibility (a11y) G This is is related to a Google internal issue target: patch This PR is targeted for the next patch release labels Feb 23, 2021
@google-cla google-cla bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Feb 23, 2021
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

src/cdk/a11y/fake-events.ts Outdated Show resolved Hide resolved
src/cdk/a11y/fake-events.ts Outdated Show resolved Hide resolved
src/cdk/a11y/fake-events.ts Outdated Show resolved Hide resolved
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Feb 23, 2021
We currently have handling for the case where a `mousedown` event is thrown off by a
fake `mousedown` listener that may be dispatched by a screen reader when an element
is activated. It turns out that if the device has touch support, screen readers may dispatch
a fake `touchstart` event instead of a fake `mousedown`.

These changes add another utility function that allows us to distinguish the fake events
and fix some issues where keyboard focus wasn't being shown because of the fake
`touchstart` events.

Fixes angular#21947.
@andrewseguin andrewseguin merged commit c7edf03 into angular:master Feb 25, 2021
andrewseguin pushed a commit that referenced this pull request Feb 25, 2021
)

We currently have handling for the case where a `mousedown` event is thrown off by a
fake `mousedown` listener that may be dispatched by a screen reader when an element
is activated. It turns out that if the device has touch support, screen readers may dispatch
a fake `touchstart` event instead of a fake `mousedown`.

These changes add another utility function that allows us to distinguish the fake events
and fix some issues where keyboard focus wasn't being shown because of the fake
`touchstart` events.

Fixes #21947.

(cherry picked from commit c7edf03)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Mar 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Accessibility This issue is related to accessibility (a11y) action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement G This is is related to a Google internal issue P2 The issue is important to a large percentage of users, with a workaround target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(MatMenu): With NVDA enabled, keyboard focus doesn't show up
3 participants