Re: [csswg-drafts] [css-transitions] Reading computed styles can immediately start then cancel transitions on newly mounted elements (#10187)

Given that this even happens when there's a call for _any element in the subtree_ of the transitioning element is there any way to counteract this other than temporarily resetting transition to `none`, forcing a reflow, then restoring its old value? (basically force cancelling the transition that was started because of the call to `getComputedStyle`)

This has been a very real issue that's bitten users of Headless UI multiple times because of third party code calling `getComputedStyle()` that we have no direct control over.

The behavior here feels very counterintuitive and also a bit complex to explain because it only affects newly added elements (or I guess more technically any elements whose computed styles were undefined at the time getComputedStyle was called). 

-- 
GitHub Notification of comment by thecrypticace
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10187#issuecomment-2083532671 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 29 April 2024 19:46:20 UTC