Open
Description
Writing some tests to familiarize with ad.js (+ bonus increase coverage) and came across:
this.originalStyle = container.style;
container.style.position = 'sticky';
container.style.top = `${stickyOffset}px`;
https://github.com/Econify/ad.js/blob/master/src/plugins/Sticky.ts#L34
Understanding is original style is a reference to container.style so the next line that sets the value of container.style overwrites the original value to be preserved in this.originalStyle
(used for restoration in .onDestroy -> .cleanUp
). As is this means position and top if set are never restored to their original values onDestroy -> cleanUp
.
Fix and test coverage here: https://github.com/Econify/ad.js/tree/bugfix/restore-original-container-style-on-destroy
Metadata
Metadata
Assignees
Labels
No labels