-
Notifications
You must be signed in to change notification settings - Fork 135
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
CircularProgressbarWithChildren does not center children #94
Comments
hmm, that's unexpected - you shouldn't need to set the svg to have
|
it is not being centralised correctly as mention by @cdosborn |
Okay, thanks for the screenshot @vitorsilvalima - I think see the issue. My mistake for not noticing it earlier - the reason I didn't see it is because I always include bootstrap 4 CSS in my demo apps, which includes a "reboot" file that contains the following declaration: svg {
vertical-align: 'middle';
} Adding that should fix the centering issue. So to work around the issue temporarily, you could add this style to the root svg element: <CircularProgressbarWithChildren
value={20}
styles={{
root: {
verticalAlign: "middle"
}
}}
>
<div>...some children...</div>
</CircularProgressbarWithChildren> This Codesandbox demonstrates the issue and shows this workaround fix: https://codesandbox.io/s/i086m I'll also include a proper fix in the next release so you don't have to use this workaround, which I'll try to push out soon. |
…tering with CircularProgressbarWithChildren (issue #94)
This should now be fixed in v2.0.1 - thanks @cdosborn and @vitorsilvalima for reporting the issue! Let me know if you have any further issues. |
🐛 Bug report
Summary of issue
I was able to correctly center text by setting the svg's root style
display: block
. I learned that the default display is inline. This causes the svg to have an expanded height that is greater than its set height to account for descenders in text that can appear alongside it. The absolute positioned children would be centered in the expanded height as opposed to the svg's visual height.The text was updated successfully, but these errors were encountered: