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(material/progress-spinner): spinner circle expands beyond the specified diameter #20289

Closed

Conversation

AlexLangdon
Copy link
Contributor

Using BASE_STROKE_WIDTH to calculate the spinner circle radius is causing issues, such as the progress spinner circle expanding and overlapping adjacent elements for stroke widths greater than 10.

The proposed solution is to use the current stroke width instead of the BASE_STROKE_WIDTH constant for calculating the spinner radius.

This will ensure that the spinner circle element always has the specified diameter and is within the parent mat-progress-spinner element.

Although this change is primarily intended to fix #20159, it will also result in fixing #19469 and #20158 as a consequence.

Also worth noting that fixing #20159 will correct the way the spinner component appears, so may lead to braking screenshot tests that depend on the incorrect behaviour.

Before change
image

After change
image

This PR supercedes PR #20062

Fixes #20159
Fixes #20158
Fixes #19469

…cified diameter

Fixes a bug in the Angular Material ‘progress-spinner’ component
where progress-spinners with a stroke width greater than 10 begin
to expand outside its specified diameter and parent element. This
is because the spinner radius calculation uses a constant stroke
width of 10 instead of the current stroke width. This fix also
allows values smaller than 11 and floating point values to be
used for the spinner custom diameters.

Fixes angular#20159
Fixes angular#20158
Fixes angular#19469
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Aug 13, 2020
@andrewseguin andrewseguin removed the cla: yes PR author has agreed to Google's Contributor License Agreement label Dec 28, 2021
@mmalerba mmalerba self-assigned this Nov 28, 2022
@mmalerba
Copy link
Contributor

Closing since this fix is for the legacy mat-progress-spinner which has been superseded by the MDC-based one.

@mmalerba mmalerba closed this Nov 28, 2022
@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 Dec 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants