From 4f8e655c9d87df0c23c92e3a3e547e71163267c9 Mon Sep 17 00:00:00 2001 From: James Chu Date: Fri, 1 Nov 2024 15:03:17 +0800 Subject: [PATCH] ZK-4960: Listbox doesn't keep scrollbar position when applying hflex="min" on a listheader in mobile --- zkdoc/release-note | 1 + zul/src/main/resources/web/js/zul/mesh/HeadWidget.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/zkdoc/release-note b/zkdoc/release-note index cf0d40fd82..f1d20fb2b2 100644 --- a/zkdoc/release-note +++ b/zkdoc/release-note @@ -46,6 +46,7 @@ ZK 10.1.0 ZK-4964: combobox input should be focused while clicking the drop-down button in Android ZK-5825: Clicking bandbox button on Android does not focus input ZK-5833: ZK-423 regression on Android + ZK-4960: Listbox doesn't keep scrollbar position when applying hflex="min" on a listheader in mobile * Upgrade Notes + Remove Htmls.encodeJavaScript(), Strings.encodeJavaScript(), Strings.escape() with Strings.ESCAPE_JAVASCRIPT, and replace them with OWASP Java Encoder APIs instead. diff --git a/zul/src/main/resources/web/js/zul/mesh/HeadWidget.ts b/zul/src/main/resources/web/js/zul/mesh/HeadWidget.ts index 2662122fbc..c5c4f7cb7d 100644 --- a/zul/src/main/resources/web/js/zul/mesh/HeadWidget.ts +++ b/zul/src/main/resources/web/js/zul/mesh/HeadWidget.ts @@ -392,7 +392,7 @@ export class HeadWidget extends zul.Widget { wgt._calcSize(); // yes, we need to do it again. } // ZK-2551: need to restore scroll pos after flexs are fixed - if (zk(ebody).hasHScroll() && currentLeft != ebody.scrollLeft) { + if (ebody.scrollWidth > ebody.clientWidth && currentLeft != ebody.scrollLeft) { ebody.scrollLeft = currentLeft; if (ehead) ehead.scrollLeft = currentLeft;