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

svg <animate> always starts playing immediately #3758

Open
Madoshakalaka opened this issue Oct 29, 2024 · 1 comment
Open

svg <animate> always starts playing immediately #3758

Madoshakalaka opened this issue Oct 29, 2024 · 1 comment
Labels

Comments

@Madoshakalaka
Copy link
Contributor

Problem
<animate> tags in svg should be able to control the start timing of the animation by setting the begin attribute. However, in Yew, the animation will always starts playing immediately. (it will play again if begin is set to some time)

Minimal Reproducible Code

#[function_component(App)]
pub fn app() -> Html {
    html! {
        <main>
            <svg width="100" height="100">
                <rect width="100" height="100" fill="black" >
                    <animate attributeName="fill" from="white" to="black" dur="1s" begin="3s" />
                </rect>
            </svg>

        </main>
    }
}

Expected behavior
The flash of white should only play once, at the 3 second mark. However, it plays at the beginning, and plays at the 3s mark.
In fact, no matter what you set begin to (even "indefinite") it will always play at the beginning.

Screenshots

Kooha-2024-10-30-06-44-36.mp4

Environment:

  • Yew version: 0.21
  • Browser: Chrome
@Madoshakalaka
Copy link
Contributor Author

I notice the default begin value is "0s", does yew somehow render the animate tag first without the attribute, triggering the animation and then add the attribute in a second render?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant