From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 776371FF16B for ; Tue, 9 Sep 2025 10:17:32 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id E03FD1905; Tue, 9 Sep 2025 10:17:35 +0200 (CEST) From: Dominik Csapak To: yew-devel@lists.proxmox.com Date: Tue, 9 Sep 2025 10:16:40 +0200 Message-ID: <20250909081701.946341-2-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250909081701.946341-1-d.csapak@proxmox.com> References: <20250909081701.946341-1-d.csapak@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.023 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [yew-devel] [PATCH yew-widget-toolkit 2/2] widget: data table: tree column: don't propagate clicks when expanding X-BeenThere: yew-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Yew framework devel list at Proxmox List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Yew framework devel list at Proxmox Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: yew-devel-bounces@lists.proxmox.com Sender: "yew-devel" and collapsing. This only matters if there is e.g. a row_click set on the table, but even in those cases we don't want to trigger that when the user expands/collapes tree elements. Signed-off-by: Dominik Csapak --- src/widget/data_table/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/widget/data_table/mod.rs b/src/widget/data_table/mod.rs index 8437aea..5c8a2a1 100644 --- a/src/widget/data_table/mod.rs +++ b/src/widget/data_table/mod.rs @@ -100,9 +100,10 @@ pub(crate) fn render_tree_node_impl( let onclick = { let key = args.record_key.clone(); let tree_store = tree_store; - move |_| { + move |event: MouseEvent| { if let Some(store) = &tree_store { if let Some(mut node) = store.write().lookup_node_mut(&key) { + event.stop_propagation(); node.set_expanded(!node.expanded()); } } -- 2.47.2 _______________________________________________ yew-devel mailing list yew-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/yew-devel