-
Notifications
You must be signed in to change notification settings - Fork 616
bugfix(Spinner): Spinner component size get's large when passing sx and size props #5236
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
Conversation
🦋 Changeset detectedLatest commit: 293ca50 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks! |
size-limit report 📦
|
👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/350104 |
Co-authored-by: Josh Black <joshblack@github.com>
Co-authored-by: Josh Black <joshblack@github.com>
} | ||
|
||
return <Spinner className={classes.SpinnerAnimation} {...props} /> | ||
return <Spinner className={clsx(className, classes.SpinnerAnimation)} {...props} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to the bug, but was pointed out that className was overwriting the CSS modules classname when being passed in, so I added this
🟢 golden-jobs completed with status |
Closes https://github.com/github/primer/issues/4391
This fixes an issue with the Spinner and CSS modules we discovered this morning. The problem is when
sx=
andsize=
is passed to the Spinner component, we render<Box as={Spinner} {...props} />
but Box accepts asize=
prop as well asSpinner
soBox
ends up creating some styles thinking that it's meant to render at different breakpoints.To fix I figured we need to not pass
size
to Box. So to fix it, I ended up removingBox
and using astyled.div
component with nothing but${sx}
inside to render any sx props passed along.This fixed the issue. We created a dev story to recreate the issue.
Changelog
New
Changed
Spinner component size get's large when passing sx and size props
Removed
Rollout strategy
Testing & Reviewing
Merge checklist