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.

Remove inline translateZ etc on transition end

See original GitHub issue

When the transition ends, how can I remove the inline style completely (not set it to 0)? Even translateZ(0) causes side effect I really don’t want (like position fixed not working on children)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:10
  • Comments:7

github_iconTop GitHub Comments

11reactions
isc30commented, Dec 16, 2021

I think documentation around this is necessary, I was having issue with position: fixed not working properly because a parent had a dangling transform: translateX(0px) when it should’ve been transform: none

@mattgperry

3reactions
Tamcommented, Apr 13, 2021

I’ve temporarily worked around this by removing the style attribute on animation complete:

const onAnimationComplete = () => {
    requestAnimationFrame(() => {
        const drawer = document.querySelector(`.${css.drawer}`);
        if (drawer) drawer.removeAttribute('style');
    });
};

(You should probably use a ref to the element instead of a querySelector, which was needed in my case)

Read more comments on GitHub >

github_iconTop Results From Across the Web

transform - CSS-Tricks
The transform property allows you to visually manipulate an element by skewing, rotating, translating, or scaling:
Read more >
Triggering a CSS transition by removing a class with Javascript
I'm having trouble figuring out why my CSS transition isn't firing when I programmatically remove a class from an element. Essentially, I am ......
Read more >
HTML DOM Style transform Property - W3Schools
The transform property applies a 2D or 3D transformation to an element. This property allows you to rotate, scale, move, skew, etc., elements....
Read more >
Docs | Utilities | SplitText - GreenSock
SplitText makes it easy to break apart the text in an HTML element so that each character, word, and/or line is in its...
Read more >
Velocity.js
It's incredibly fast, and it features color animation, transforms, loops, easings, SVG support, and scrolling. It is the best of jQuery and CSS...
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