mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 12:20:20 +01:00
Add getComputedStyle helper to ViewTransition refs (#32751)
This is also sometimes useful to read the style of the pseudo-element itself without an animation.
This commit is contained in:
parent
fceb0f80bc
commit
f134b3993a
|
|
@ -2085,6 +2085,7 @@ export function stopViewTransition(transition: RunningViewTransition) {
|
|||
interface ViewTransitionPseudoElementType extends Animatable {
|
||||
_scope: HTMLElement;
|
||||
_selector: string;
|
||||
getComputedStyle(): CSSStyleDeclaration;
|
||||
}
|
||||
|
||||
function ViewTransitionPseudoElement(
|
||||
|
|
@ -2138,6 +2139,14 @@ ViewTransitionPseudoElement.prototype.getAnimations = function (
|
|||
}
|
||||
return result;
|
||||
};
|
||||
// $FlowFixMe[prop-missing]
|
||||
ViewTransitionPseudoElement.prototype.getComputedStyle = function (
|
||||
this: ViewTransitionPseudoElementType,
|
||||
): CSSStyleDeclaration {
|
||||
const scope = this._scope;
|
||||
const selector = this._selector;
|
||||
return getComputedStyle(scope, selector);
|
||||
};
|
||||
|
||||
export function createViewTransitionInstance(
|
||||
name: string,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user