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

[Bug: Spinner] Spinner cannot be vertically aligned properly due to descender on span #11843

Open
LA1CH3 opened this issue Apr 5, 2024 · 0 comments
Labels
Bug Something is broken and not working as intended in the system. untriaged

Comments

@LA1CH3
Copy link
Contributor

LA1CH3 commented Apr 5, 2024

Summary

See this comment (https://github.com/Shopify/web/pull/122620#discussion_r1552204022).

If Spinner is used in a flex row with other components, and align-items: center is applied, the Spinner is not quite vertically centered.

The root of the issue lies in the Polaris spinner component, which is wrapped in a span. This makes it an inline element and introduces additional bottom spacing reserved for descenders. As a result, even though the flex container wrapping all buttons is set to center alignment, it doesn't properly align the spinner due to the extra whitespace inherent to the spinner element.

Expected behavior

The Spinner is vertically aligned as expected.

Actual behavior

Screenshot 2024-04-04 at 11 09 36 AM (2)

Steps to reproduce

Link to sandbox

Are you using React components?

Yes

Polaris version number

"12.26.0"

Browser

Latest Chrome

Device

Macbook pro

@LA1CH3 LA1CH3 added Bug Something is broken and not working as intended in the system. untriaged labels Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken and not working as intended in the system. untriaged
Projects
None yet
Development

No branches or pull requests

1 participant