From 72765d05aacbb4096624afd62318bb5adf48ea7a Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 6 Dec 2026 10:03:24 +0100 Subject: [PATCH] thing-core(tests): place blank/other below session overlay list in light-dismiss test --- crates/thing-core/src/input/tests.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/crates/thing-core/src/input/tests.rs b/crates/thing-core/src/input/tests.rs index 1ae745e..1e2ef03 100644 --- a/crates/thing-core/src/input/tests.rs +++ b/crates/thing-core/src/input/tests.rs @@ -1162,7 +1162,7 @@ fn session_overlay_skips_focus_order_hits_rows_without_blurring_and_light_dismis "root", None, Overflow::Visible, - vec![select_control("pick", "choose"), button("other", "other", 160.0, 32.0), fixed("blank", 160.0, 64.0)], + vec![select_control("pick", "choose"), fixed("blank", 160.0, 80.0), button("other", "other", 160.0, 32.0)], ), vec![decl("choose", &[]), decl("other", &[])], ); @@ -1209,12 +1209,20 @@ fn session_overlay_skips_focus_order_hits_rows_without_blurring_and_light_dismis assert_eq!(commands_of(&rig.minted()), ["choose"], "{mode:?}"); assert_eq!(rig.draft("pick"), Some(InputValue::Choice(ChoiceValue { value: "b".into() })), "{mode:?}"); - // Re-open session: clicking outside (on blank background) light-dismisses and clears focus. + // Re-open session: clicking outside (bottom of blank, below the overlay) light-dismisses and clears focus. rig.input.open_session(select_session("pick")); let blank = rig.rect("blank"); - rig.click(inside(blank)); + rig.click((blank.x + 0.5, blank.y + blank.h - 0.5)); assert!(rig.input.session().is_none(), "{mode:?}"); assert!(rig.input.focus().node().is_none(), "{mode:?}"); + + // Re-open session: clicking outside on another button light-dismisses and activates that button. + rig.input.open_session(select_session("pick")); + let other = rig.rect("other"); + rig.click((other.x + 0.5, other.y + other.h - 0.5)); + assert!(rig.input.session().is_none(), "{mode:?}"); + assert_eq!(rig.input.focus().node(), Some(&nid("other")), "{mode:?}"); + assert_eq!(commands_of(&rig.minted()), ["other"], "{mode:?}"); } }