diff --git a/src/core/wrapper/layout/sticky/sticky.horizontal.js b/src/core/wrapper/layout/sticky/sticky.horizontal.js index a59dd6edf..afdf955aa 100644 --- a/src/core/wrapper/layout/sticky/sticky.horizontal.js +++ b/src/core/wrapper/layout/sticky/sticky.horizontal.js @@ -21,13 +21,29 @@ BI.HorizontalStickyLayout = BI.inherit(BI.FlexHorizontalLayout, { } } if (columnSize !== "fill") { - var firstItemFill = o.columnSize[0] === "fill" || o.items[0].width === "fill"; - w.element.css({ - position: "sticky", - zIndex: 1, - left: firstItemFill ? "" : 0, - right: firstItemFill ? 0 : "" + var fillIndex; + BI.count(0, o.items.length - 1, index => { + if (BI.isNotNull(fillIndex)) { + return; + } + if ((o.columnSize[index] === "fill" || o.items[index].width === "fill")) { + fillIndex = index; + } }); + + if (fillIndex > i) { + w.element.css({ + position: "sticky", + zIndex: 1, + left: 0, + }); + } else { + w.element.css({ + position: "sticky", + zIndex: 1, + right: 0 + }); + } } else { w.element.css({ overflow: "" diff --git a/src/core/wrapper/layout/sticky/sticky.vertical.js b/src/core/wrapper/layout/sticky/sticky.vertical.js index 970d84eef..beb0e9d43 100644 --- a/src/core/wrapper/layout/sticky/sticky.vertical.js +++ b/src/core/wrapper/layout/sticky/sticky.vertical.js @@ -21,13 +21,29 @@ BI.VerticalStickyLayout = BI.inherit(BI.FlexVerticalLayout, { } } if (rowSize !== "fill") { - var firstItemFill = o.rowSize[0] === "fill" || o.items[0].height === "fill"; - w.element.css({ - position: "sticky", - zIndex: 1, - top: firstItemFill ? "" : 0, - bottom: firstItemFill ? 0 : "" + var fillIndex; + BI.count(0, o.items.length - 1, index => { + if (BI.isNotNull(fillIndex)) { + return; + } + if ((o.rowSize[index] === "fill" || o.items[index].height === "fill")) { + fillIndex = index; + } }); + + if (fillIndex > i) { + w.element.css({ + position: "sticky", + zIndex: 1, + top: 0, + }); + } else { + w.element.css({ + position: "sticky", + zIndex: 1, + bottom: 0 + }); + } } else { w.element.css({ overflow: ""