Added Firefox support for making Order Summary sticky when not longer than view (#49744)
* Added getComputedStyle for Firefox support * Added changelog * Reverted pnpm-lock.yaml
This commit is contained in:
parent
7e13bbcbf4
commit
3d148e2577
|
@ -43,10 +43,22 @@ export function useObservedViewport< T extends HTMLElement >(): [
|
||||||
const resizeObserver = new ResizeObserver( ( entries ) => {
|
const resizeObserver = new ResizeObserver( ( entries ) => {
|
||||||
entries.forEach( ( entry ) => {
|
entries.forEach( ( entry ) => {
|
||||||
if ( entry.target === element ) {
|
if ( entry.target === element ) {
|
||||||
|
let elementTop = '0';
|
||||||
|
|
||||||
|
if ( element.computedStyleMap ) {
|
||||||
|
elementTop =
|
||||||
|
element
|
||||||
|
.computedStyleMap()
|
||||||
|
.get( 'top' )
|
||||||
|
?.toString() || elementTop;
|
||||||
|
} else {
|
||||||
|
// Firefox support
|
||||||
|
elementTop =
|
||||||
|
getComputedStyle( element ).top || elementTop;
|
||||||
|
}
|
||||||
|
|
||||||
const { height, width } = entry.contentRect;
|
const { height, width } = entry.contentRect;
|
||||||
const elementTop =
|
|
||||||
element.computedStyleMap().get( 'top' )?.toString() ||
|
|
||||||
'0';
|
|
||||||
setObservedElement( {
|
setObservedElement( {
|
||||||
height: height + parseInt( elementTop, 10 ),
|
height: height + parseInt( elementTop, 10 ),
|
||||||
width,
|
width,
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: fix
|
||||||
|
Comment: Added computedStyleMap for Firefox support in making the Order Summary sticky when not longer than view
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue