Repository: zng-ui/zng (language: rust)

Issue:
Log error on attempt to use capture only property in other widgets
Currently this fails silently


Discussion / hints:

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 787cc2ed8..b927eda7d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,6 @@
 # Unreleased
 
+* Add debug validation of capture only property use in widgets that don't capture it.
 * Fix Wayland custom chrome breaking window padding.
 * Fix window text properties affecting the Wayland fallback chrome text.
 * Fix `swgl` build error.
diff --git a/crates/zng-app/src/widget/builder.rs b/crates/zng-app/src/widget/builder.rs
index 5fde5b6c8..159998d75 100644
--- a/crates/zng-app/src/widget/builder.rs
+++ b/crates/zng-app/src/widget/builder.rs
@@ -2549,6 +2549,18 @@ impl WidgetBuilding {
             match item {
                 WidgetItem::Property { args, captured, .. } => {
                     if !captured {
+                        #[cfg(debug_assertions)]
+                        {
+                            let p = args.property();
+                            if p.capture {
+                                tracing::error!(
+                                    "capture only property `{}` is not captured in `{}!`, it will have no effect",
+                                    p.name,
+                                    self.widget_type.name()
+                                );
+                            }
+                        }
+
                         node = args.instantiate(node);
 
                         #[cfg(feature = "trace_wgt_item")]


Test patch: