all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: yew-devel@lists.proxmox.com
Subject: [yew-devel] [PATCH yew-widget-toolkit 2/2] widget: data table: tree column: don't propagate clicks when expanding
Date: Tue,  9 Sep 2025 10:16:40 +0200	[thread overview]
Message-ID: <20250909081701.946341-2-d.csapak@proxmox.com> (raw)
In-Reply-To: <20250909081701.946341-1-d.csapak@proxmox.com>

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 <d.csapak@proxmox.com>
---
 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<T>(
         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


      reply	other threads:[~2025-09-09  8:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-09  8:16 [yew-devel] [PATCH yew-widget-toolkit 1/2] widget: data table: column: allow setting vertical align Dominik Csapak
2025-09-09  8:16 ` Dominik Csapak [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250909081701.946341-2-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=yew-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal