-
-
Notifications
You must be signed in to change notification settings - Fork 332
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
V3 ProgressRing always displays 100% on iOS for values greater than 0 #3222
Comments
This issue also exist in macOS sarfari |
I was curious about that, thanks for confirming Null. Here's a screenshot on Safari. It's the same on both Svelte and React. However Zag's example is working, so this is an implementation issue on our end: If I was to guess, I'd assume the way we're passing the prop values to the CSS custom properties isn't compatible on Safari. We have a few components that got outside of normal values and use CSS custom properties, so we should evaluate a universal solution for these. |
Based on the Zag documentation, pixel values are used for calculations—even though percentage values are not explicitly prohibited. However, since the Skeleton framework relies on percentages, Safari might have rendered inconsistencies with this approach. I did some testing, and the following seems to fix the issue. Although using this will result the progress ring being rendered slightly thicker than before <svg
{...api.getCircleProps()}
class="{svgBase} {svgClasses} {rxAnimCircle}"
style="--size:100%;--thickness:{strokeWidth};"
data-testid="progress-ring-svg"
> Revised Code: <svg
viewBox="0 0 100 100"
{...api.getCircleProps()}
class="{svgBase} {svgClasses} {rxAnimCircle}"
style="--size:100px;--thickness:{strokeWidth};"
data-testid="progress-ring-svg"
> |
@nullpointerexceptionkek can you share a screenshot of before vs after? |
|
Ok that's not bad at all - I was worried it would be super dramatic. Looks good to me. I'd welcome a PR with this change! |
Yeah, I'll do some testing to ensure it doesn't add some additional styling issues. |
Cool. Make sure to check the |
Hi @endigo9740, I spent some more time investigating this issue and can confirm that it's caused by passing a percentage ( <script lang="ts">
import * as progress from "@zag-js/progress";
import { normalizeProps, useMachine } from "@zag-js/svelte";
const [snapshot, send] = useMachine(progress.machine({ id: "1" }));
const api = $derived(progress.connect(snapshot, send, normalizeProps));
</script>
<div style="height: 120px; width: 120px">
<div {...api.getRootProps()}>
<div {...api.getLabelProps()}>Upload progress</div>
<svg {...api.getCircleProps()}>
<circle {...api.getCircleTrackProps()} />
<circle {...api.getCircleRangeProps()} />
</svg>
</div>
</div>
<style>
[data-scope="progress"] {
--size: 100%;
--thickness: 10px;
}
</style> Using a Additionally, I noticed another issue: when the progress ring size increases(EX: size-64), the indeterminate progress renders incorrectly, showing a break in the track ring. I'm not sure if this is a Zag issue or something else. |
Thanks for sharing this info. Yeah I'm aware of the size breaking the animation. We have another issue tracking that issue. For now, given the scope of these changes, leave this to me. I need to dig in and try this myself. I'll follow up as needed though. |
It's always Safari that refuses to work with the web 😒 |
Current Behavior
On iOS (Safari), the ProgressRing component does not display progress correctly:
If value = 0, it displays correctly as 0% progress.
If value > 0 (even 1), it immediately jumps to 100% progress, ignoring the actual value.
The issue occurs only in iOS browsers, the component works correctly on desktop browsers.
Expected Behavior
ProgressRing should display the correct progress value on iOS just like it does on desktop.
The ring should scale between 0% and 100%, rather than jumping to fully completed for any nonzero value.
It should maintain smooth transitions on iOS devices.
Steps To Reproduce
Link to Reproduction / Stackblitz
No response
Environment Information
No response
More Information
No response
The text was updated successfully, but these errors were encountered: