git.lucas.co / cce-ui
GPU-accelerated UI toolkit (Vulkan)
git clone https://git.lucas.co/cce-ui.git

commitdb503309370e1dc99aed17562b8c3489cae5c089
parent6babe32920
authorLucas Galante <[email protected]>
date2026-08-30 19:59
fix: a pressed choice row claims the params focus like every other row

The ParametersBg mouse-press choice branch was the ONE row type that
never set focused_param — code, text, spinbox, slider, float3 and
color all do — and the Event::KeyInput arm is gated on it, so
Escape/arrows/Enter could never reach an open params dropdown (found
via cce-designer, whose only widget key path is a direct
param.keyboard_input). Claimed while the dropdown is open, released
when it closes, mirroring the textbox row's editing pattern.

Co-Authored-By: Claude Fable 5 <[email protected]>

 src/widget/container/parameters_bg.rs | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/widget/container/parameters_bg.rs b/src/widget/container/parameters_bg.rs
index 8b7d581..1cb70e0 100644
--- a/src/widget/container/parameters_bg.rs
+++ b/src/widget/container/parameters_bg.rs
@@ -2074,6 +2074,17 @@ impl Input for ParametersBg {
                     if p.2.starts_with("choice") {
                         if let Some(d) = &mut self.choices[i] {
                             if d.mouse_input(button, state, px, py, ui) {
+                                // Claim the param focus while the dropdown is
+                                // open — the KeyInput arm above is gated on
+                                // `focused_param`, and without this the choice
+                                // row was the ONE row type that never set it,
+                                // so Escape/arrows/Enter could not reach an
+                                // open params dropdown (found via cce-designer).
+                                if d.open {
+                                    self.focused_param = Some(i);
+                                } else if self.focused_param == Some(i) {
+                                    self.focused_param = None;
+                                }
                                 if d.take_change() {
                                     if let Some(val) = d.get_value_string() {
                                         p.1 = val;