* [yew-devel] [PATCH yew-widget-toolkit] widget: data table: don't fire extra selection change event
@ 2025-12-15 13:03 Dominik Csapak
2025-12-16 8:41 ` [yew-devel] applied: " Dietmar Maurer
0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2025-12-15 13:03 UTC (permalink / raw)
To: yew-devel
Instead of always clearing the selection and toggling the correct one,
directly select the correct one if the selection is not in multiselect
mode.
This prevents multiple selection change events when a user clicks a line
in the data table. (namely one from the clear, and one from the toggle)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
src/widget/data_table/data_table.rs | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/widget/data_table/data_table.rs b/src/widget/data_table/data_table.rs
index 7805340..1372a43 100644
--- a/src/widget/data_table/data_table.rs
+++ b/src/widget/data_table/data_table.rs
@@ -787,11 +787,16 @@ impl<S: DataStore> PwtDataTable<S> {
self.last_select_position = Some(cursor);
- if !(shift || ctrl) && props.multiselect_mode != MultiSelectMode::Simple {
- selection.clear();
+ if selection.is_multiselect() {
+ if !(shift || ctrl) && props.multiselect_mode != MultiSelectMode::Simple {
+ selection.clear();
+ }
+
+ selection.toggle(record_key.clone());
+ } else {
+ selection.select(record_key.clone());
}
- selection.toggle(record_key.clone());
true
}
--
2.47.3
_______________________________________________
yew-devel mailing list
yew-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/yew-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* [yew-devel] applied: [PATCH yew-widget-toolkit] widget: data table: don't fire extra selection change event
2025-12-15 13:03 [yew-devel] [PATCH yew-widget-toolkit] widget: data table: don't fire extra selection change event Dominik Csapak
@ 2025-12-16 8:41 ` Dietmar Maurer
0 siblings, 0 replies; 2+ messages in thread
From: Dietmar Maurer @ 2025-12-16 8:41 UTC (permalink / raw)
To: Yew framework devel list at Proxmox, Dominik Csapak
applied
_______________________________________________
yew-devel mailing list
yew-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/yew-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-12-16 8:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-15 13:03 [yew-devel] [PATCH yew-widget-toolkit] widget: data table: don't fire extra selection change event Dominik Csapak
2025-12-16 8:41 ` [yew-devel] applied: " Dietmar Maurer
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.