Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/wild-wolves-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@lynx-js/web-elements": patch
---

fix: list `bindscrolltolower` may not trigger because the lower threshold
sentinel had no effective size or offset, causing the bottom
`IntersectionObserver` to miss the list boundary
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ exports[`executeTemplate should run lepusCode.root from basic-element-list-basic
<div
class="observer placeholder-dom"
id="upper-threshold-observer"
part="upper-threshold-sentinel"
></div>
</div>
<slot part="slot"></slot>
Expand All @@ -83,6 +84,7 @@ exports[`executeTemplate should run lepusCode.root from basic-element-list-basic
<div
class="observer placeholder-dom"
id="lower-threshold-observer"
part="lower-threshold-sentinel"
></div>
</div></div></template></x-list
></x-view></div></template
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,37 @@ x-list[x-enable-scrolltoloweredge-event]::part(lower-threshold-observer) {
display: flex;
}

x-list[x-enable-scrolltoupper-event]::part(upper-threshold-sentinel),
x-list[x-enable-scrolltoupperedge-event]::part(upper-threshold-sentinel),
x-list[x-enable-scrolltolower-event]::part(lower-threshold-sentinel),
x-list[x-enable-scrolltoloweredge-event]::part(lower-threshold-sentinel) {
flex: 0 0 1px;
}

x-list[x-enable-scrolltoupper-event]::part(upper-threshold-sentinel),
x-list[x-enable-scrolltoupperedge-event]::part(upper-threshold-sentinel) {
margin-bottom: -1px;
}

x-list[x-enable-scrolltolower-event]::part(lower-threshold-sentinel),
x-list[x-enable-scrolltoloweredge-event]::part(lower-threshold-sentinel) {
margin-top: -1px;
transform: translateY(1px);
}

x-list[scroll-orientation="horizontal"][x-enable-scrolltoupper-event]::part(upper-threshold-sentinel),
x-list[scroll-orientation="horizontal"][x-enable-scrolltoupperedge-event]::part(upper-threshold-sentinel) {
margin-bottom: 0;
margin-right: -1px;
}

x-list[scroll-orientation="horizontal"][x-enable-scrolltolower-event]::part(lower-threshold-sentinel),
x-list[scroll-orientation="horizontal"][x-enable-scrolltoloweredge-event]::part(lower-threshold-sentinel) {
margin-top: 0;
margin-left: -1px;
transform: translateX(1px);
}

x-list::part(lower-threshold-observer) {
flex-direction: column-reverse;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ export const templateXList = `<style>
<div
class="observer placeholder-dom"
id="upper-threshold-observer"
part="upper-threshold-sentinel"
></div>
</div>
<slot part="slot"></slot>
Expand All @@ -158,6 +159,7 @@ export const templateXList = `<style>
<div
class="observer placeholder-dom"
id="lower-threshold-observer"
part="lower-threshold-sentinel"
></div>
</div>
</div>`;
Expand Down
2 changes: 2 additions & 0 deletions packages/web-platform/web-elements/src/template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ pub const TEMPLATE_X_LIST: &str = r#"<style>
<div
class="observer placeholder-dom"
id="upper-threshold-observer"
part="upper-threshold-sentinel"
></div>
</div>
<slot part="slot"></slot>
Expand All @@ -165,6 +166,7 @@ pub const TEMPLATE_X_LIST: &str = r#"<style>
<div
class="observer placeholder-dom"
id="lower-threshold-observer"
part="lower-threshold-sentinel"
></div>
</div>
</div>"#;
Expand Down
Loading