Skip to content

bug(focus indicators): Focus indicators are now positioned. #19345

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

Merged
merged 2 commits into from
Jun 5, 2020

Conversation

zelliott
Copy link
Collaborator

  • Just as every .mat-ripple is positioned in order to create an easy API for developers, every .mat-focus-indicator should be positioned. This way, when developers add the class .mat-focus-indicator to their own custom focusable elements they do not also need to position the element.
  • As a result of positioning every .mat-focus-indicator, a few components that set position: absolute on the associated element need to have their specificity bumped.
  • In testing this change, I fixed a few bugs as a result of fix(datepicker): strong focus indication in calendar always shown #19304 (comments inline).

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label May 13, 2020
Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

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

LGTM, but @jelbourn might have an opinion on this.

@zelliott
Copy link
Collaborator Author

@jelbourn Before merging this, let's close on whether the style .mat-focus-indicator { position: relative; } should be within mat-strong-focus-indicators or mat-core. See the associated comment on the PR.

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.

Replied via email, but I'm good with adding the relative style in mat-core (assuming the TGP works out)

@zelliott zelliott requested a review from devversion as a code owner May 13, 2020 18:53
@zelliott zelliott requested a review from jelbourn May 13, 2020 18:59

// The focus indicator should match the bounds of the entire button.
.mat-mdc-focus-indicator {
@include mat-fill();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Before this change, this element had essentially no styles, and thus the focus indicator actually rendered relative to the parent button. Now that we've added position: relative to this element, the fact that it has no styles is problematic (the focus indicator doesn't render with the correct bounding box). Consequently, use mat-fill to make this element match the bounds of the entire button.

@zelliott
Copy link
Collaborator Author

TGP LGTM, sent the link to you @jelbourn.

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, just minor naming comment

@jelbourn jelbourn added lgtm target: patch This PR is targeted for the next patch release labels May 15, 2020
@zelliott
Copy link
Collaborator Author

Addressed naming comment, rebased and squashed commits.

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

@jelbourn jelbourn added action: merge The PR is ready for merge by the caretaker merge: fix commit message When the PR is merged, rewrites/fixups of the commit messages are needed and removed needs rebase labels May 18, 2020
…lesheets are ordered improperly in Karma unit tests.
@zelliott zelliott requested a review from jelbourn June 4, 2020 18:08
@jelbourn jelbourn added target: major This PR is targeted for the next major release and removed target: patch This PR is targeted for the next patch release labels Jun 5, 2020
@jelbourn jelbourn merged commit c05a07e into angular:master Jun 5, 2020
@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 Jul 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement merge: fix commit message When the PR is merged, rewrites/fixups of the commit messages are needed target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants