Skip to content

High contrast focus indicators conflict with strong focus indicators #24097

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

Closed
1 task done
zelliott opened this issue Dec 14, 2021 · 3 comments · Fixed by #24120
Closed
1 task done

High contrast focus indicators conflict with strong focus indicators #24097

zelliott opened this issue Dec 14, 2021 · 3 comments · Fixed by #24120
Assignees
Labels
Accessibility This issue is related to accessibility (a11y) G This is is related to a Google internal issue P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@zelliott
Copy link
Collaborator

zelliott commented Dec 14, 2021

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

Unsure - will have to look - but I'm fairly certain this is a regression.

Description

I noticed that dedicated focus indicators for Windows HCM have been added to various components (#22145, #22889). Unfortunately, these HCM focus indicators conflict with the existing system-wide strong focus indicators if the user has opted into strong focus indicators. By "conflict", I mean multiple focus indicators render where only one should render.

For example, in the screenshot below, two focus indicators render on a radio button when in HCM with strong focus indicators opted-in.

image

I'm not sure yet how many components this bug affects, but I wanted to file this sooner rather than later so that we didn't merge in some pending PRs (#22889) until a fix was identified.

Reproduction

I'd share a Stackblitz link, but Stackblitz is being buggy at the moment and so repro steps are a bit more involved.

Steps to reproduce:

  1. Go to material.angular.io/components/checkbox/examples on a Windows PC.
  2. Open the first example in Stackblitz.
  3. Add the mat.strong-focus-indicators styles to the theme.scss file:
@include mat.strong-focus-indicators();
@include mat.strong-focus-indicators-theme($theme);
  1. Turn on HCM.
  2. Refresh the Stackblitz.
  3. Focus the first checkbox in the Stackblitz demo.
  4. Observe the double focus indicator on the checkbox.

Expected Behavior

One focus indicator should be present on the checkbox.

Actual Behavior

Two focus indicators were present on the checkbox.

Environment

  • Angular: Latest
  • CDK/Material: Latest
  • Browser(s): All
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows
@crisbeto
Copy link
Member

It's worth noting that the majority of the HC-specific styles were in place long before the strong focus indicators.

@zelliott
Copy link
Collaborator Author

To resolve this, we need to show one of either the HCM outline or the strong focus indicator when HCM is on and strong focus indicators is opted in. If we want to show just the HCM outline, we should be able to add logic to the strong focus indicator mixin that only applies styles if the HCM class isn't detected on the body. If we want to show just the strong focus indicators, I'm not sure how to do so. We'd have to be able to check within the high contrast mixin if strong focus indicators are enabled, and I'm not sure how to check to see if a mixin has been included.

crisbeto added a commit to crisbeto/material2 that referenced this issue Dec 18, 2021
…mode

Most components have special handling for high contrast mode which can cause double focus indication when strong focus indication is disabled.

These changes remove the strong focus indicators if such a case is detected.

Fixes angular#24097.
@crisbeto crisbeto self-assigned this Dec 19, 2021
@crisbeto crisbeto added Accessibility This issue is related to accessibility (a11y) G This is is related to a Google internal issue has pr P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent and removed needs triage This issue needs to be triaged by the team labels Dec 19, 2021
wagnermaciel pushed a commit that referenced this issue Jan 10, 2022
…mode (#24120)

Most components have special handling for high contrast mode which can cause double focus indication when strong focus indication is disabled.

These changes remove the strong focus indicators if such a case is detected.

Fixes #24097.

(cherry picked from commit 040ef57)
wagnermaciel pushed a commit that referenced this issue Jan 10, 2022
…mode (#24120)

Most components have special handling for high contrast mode which can cause double focus indication when strong focus indication is disabled.

These changes remove the strong focus indicators if such a case is detected.

Fixes #24097.
@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 Feb 10, 2022
forsti0506 pushed a commit to forsti0506/components that referenced this issue Apr 3, 2022
…mode (angular#24120)

Most components have special handling for high contrast mode which can cause double focus indication when strong focus indication is disabled.

These changes remove the strong focus indicators if such a case is detected.

Fixes angular#24097.
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) G This is is related to a Google internal issue P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants