Skip to content

Commit acfafb7

Browse files
committed
fix: offset possible transform: translateY animation 'uk-animation-slide-top' while hiding
1 parent 920aca6 commit acfafb7

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## WIP
4+
5+
### Fixed
6+
7+
- Fix Sticky component calculates wrong top offset, when animation is in progress
8+
39
## 3.21.8 (July 25, 2024)
410

511
### Fixed

src/js/core/sticky.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,10 @@ export default {
188188
}
189189

190190
const overflow = this.overflowFlip ? 0 : Math.max(0, height + offset - viewport);
191-
const topOffset = getOffset(referenceElement).top;
191+
const topOffset =
192+
getOffset(referenceElement).top -
193+
// offset possible `transform: translateY` animation 'uk-animation-slide-top' while hiding
194+
new DOMMatrix(css(referenceElement, 'transform')).m42;
192195
const elHeight = dimensions(this.$el).height;
193196

194197
const start =

0 commit comments

Comments
 (0)