question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Begin animation in styles

See original GitHub issue

I have the following style:

<Style Selector="RadioButton:pressed /template/ Ellipse#InteractionEllipse">
    <Style.Animations>
        <Animation Duration="0:0:0.3">
            <KeyFrame Cue="0%">
                <Setter Property="Opacity" Value="0.3"></Setter>
            </KeyFrame>
            <KeyFrame Cue="100%">
                <Setter Property="Opacity" Value="0"></Setter>
            </KeyFrame>
        </Animation>
    </Style.Animations>
</Style>

It works, but it interrupts as soon as I stop pressing the button. It would be nice to be able not to interrupt the animation when the style removed, but to let it run to the end. Is there such a possibility?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
maxkatz6commented, Sep 18, 2020

@SKProCH so you can implement some kind of mixin with custom pseudoclass. Add and remove it on specific events. Example: https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Controls/Mixins/PressedMixin.cs

0reactions
SKProCHcommented, Sep 18, 2020

And I am not sure about details, when animation should be running in your case, but RadioButton has “:checked” pseudoclass, which you can use to run animation only when it is checked. It also has “:unchecked” and “:indeterminate”.

Yes, I know, but here it was necessary to start the animation with any click on the button. And if using :checked, the animation would not react to repeated (if you click on an already checked button again, it will still remain checked) clicks (which is correct).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using CSS animations - CSS: Cascading Style Sheets | MDN
To create a CSS animation sequence, you style the element you want to animate with the animation property or its sub-properties. This lets...
Read more >
CSS Animations
An animation lets an element gradually change from one style to another. You can change as many CSS properties you want, as many...
Read more >
Starting CSS Animations Mid-Way
The trick is to use negative animation-delay . That will begin an animation right away, but as if part of the animation has...
Read more >
10 Animation Styles for Beginners (& Inspiring Styles)
We've created a list of 10 animation styles and techniques for beginners in animation. The best part? We've included interesting examples to ...
Read more >
CSS Animation for Beginners
In this post we're going to walk through the basics of CSS animation. You can follow along and view the CSS code for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found