Skip to content

Commit e46b867

Browse files
authored
fix(ui5-list): adjust observer to handle sticky headers (#11526)
Problem: The list's onLoadMore event is not triggered in Firefox at certain zoom levels when a sticky header is present. This is due to how Firefox calculates intersections with sticky positioned elements, causing subpixel rendering issues. Solution: Use the proper scroll container as the root for the IntersectionObserver and add a rootMargin of 5px. Similar to: #11242 Fixes: #11461
1 parent a661e82 commit e46b867

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/main/src/List.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ import type CheckBox from "./CheckBox.js";
7575
import type RadioButton from "./RadioButton.js";
7676
import { isInstanceOfListItemGroup } from "./ListItemGroup.js";
7777
import type ListItemGroup from "./ListItemGroup.js";
78+
import { findVerticalScrollContainer } from "./TableUtils.js";
7879

7980
const INFINITE_SCROLL_DEBOUNCE_RATE = 250; // ms
8081

@@ -1425,9 +1426,11 @@ class List extends UI5Element {
14251426

14261427
getIntersectionObserver() {
14271428
if (!this.growingIntersectionObserver) {
1429+
const scrollContainer = this.scrollContainer || findVerticalScrollContainer(this.getDomRef()!);
1430+
14281431
this.growingIntersectionObserver = new IntersectionObserver(this.onInteresection.bind(this), {
1429-
root: null,
1430-
rootMargin: "0px",
1432+
root: scrollContainer,
1433+
rootMargin: "5px",
14311434
threshold: 1.0,
14321435
});
14331436
}

0 commit comments

Comments
 (0)