From b05a94a5b5f54dd9e467a66272fb11d4776a1a96 Mon Sep 17 00:00:00 2001 From: ViceEye Date: Thu, 6 Aug 2026 19:21:40 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=BB=9A=E5=8A=A8?= =?UTF-8?q?=E6=9D=A1=E4=B8=8D=E8=A2=AB=E9=9A=90=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../native_runtime/lifecycle_mixin.py | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/PyreactRuntimeScript/native_runtime/lifecycle_mixin.py b/PyreactRuntimeScript/native_runtime/lifecycle_mixin.py index d52d9e2..0c5183e 100644 --- a/PyreactRuntimeScript/native_runtime/lifecycle_mixin.py +++ b/PyreactRuntimeScript/native_runtime/lifecycle_mixin.py @@ -1525,8 +1525,26 @@ def _apply_scroll_props(self, node, node_path): show_scrollbar = props.get("showScrollbar", True) track_path = self._get_scrollbar_track_path(node_path) - if track_path: - self._safe_set_visible(track_path, show_scrollbar) + if not track_path: + return + + # Native scrolling_panel does not reliably cascade SetVisible from + # bar_and_track to its track/scroll_box descendants. Hide all known + # layers so showScrollbar=False removes both the rail and thumb. + paths = [ + track_path, + track_path + "/stack_panel", + track_path + "/stack_panel/panel", + track_path + "/stack_panel/panel/centered_panel", + track_path + "/stack_panel/panel/centered_panel/track", + track_path + "/stack_panel/panel/centered_panel/scroll_box", + track_path + "/panel", + track_path + "/panel/centered_panel", + track_path + "/panel/centered_panel/track", + track_path + "/panel/centered_panel/scroll_box", + ] + for path in paths: + self._safe_set_visible(path, show_scrollbar) def _get_real_scroll_view_path(self, scroll_node_path): if not scroll_node_path: