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.

New style only applied to transitioned element

See original GitHub issue

Describe the bug If you apply a text color between transitions, the color only applies to the element which transitions, and not the static element. Say you have 10 and want to increment to 11, before you increment, the text color is white. Then when you increment to 11, and you have set the color to be green, or red, only the numer that transitioned (from 0 to 1) will have the new applied text color.

Expected behavior Expected behaviour is to have all number elements be the same numberStyle

Screenshots Before Transition: image

After Transition: image

Here’s my code for the example in the screenshot:

const Points = ({id}) => {
    const card = useRecoilValue(cardItemState(id));

    const pointStyle = {
        color: ["#f10033", "#fff", "#28c120"][card.vote + 1]
    }

    return (
        <Styled.Points>
            <FlipNumbers numberStyle={pointStyle} height={28} width={14} color="" numbers={card.points.toString()} play />
        </Styled.Points>
    );
}

Desktop:

  • OS: Window
  • Browser: Chrome
  • Version: 85.0.4183.102 (Official Build) (64-bit)

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
TheLifeIsYourscommented, Sep 22, 2020

I did, some pretty tight spaghett. 🍝 😄

1reaction
bluebill1049commented, Sep 22, 2020

not sure man, it’s been awhile… take a look the source code 👀

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using CSS transitions - CSS: Cascading Style Sheets | MDN
transition -property. Specifies the name or names of the CSS properties to which transitions should be applied. Only properties listed here are ...
Read more >
css transitions on new elements - Stack Overflow
I found a nicer way to trigger layout and make transitions work just after appending the element to the DOM: window.
Read more >
transition | CSS-Tricks
The transition property is a shorthand property used to represent up to four transition-related longhand properties:
Read more >
Transition Metals - The Parts of the Periodic Table
The transition elements or transition metals occupy the short columns in the center of the periodic table, between Group 2A and Group 3A....
Read more >
CSS ::before and ::after for custom animations and transitions
Pseudo-elements are CSS selectors used to insert artificial or decorative content. ... but just in case, we'll take a cursory look at them....
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