From 762082b15aef40421a958a04234abacf9f18738f Mon Sep 17 00:00:00 2001 From: ToBinio Date: Fri, 24 Oct 2025 16:03:01 +0200 Subject: [PATCH] =?UTF-8?q?ui=5Finput:=20Don=E2=80=99t=20focus=20previous?= =?UTF-8?q?=20on=20decrement=20in=20`NumberField`=20(#41095)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR removes the behavior that the number_field changes focus to the previous element when using the decrement button. I mainly noticed this while decreasing the tab-size of a language, since it there closes the page... Please note that I am unsure what if any purpose this code has. I was unable to find a use case and since it is not present in the `increment_handler` I guess it should never have been here --- Release Notes: * Fixed wrongly focus previous element on number_field decrement --- crates/ui_input/src/number_field.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/crates/ui_input/src/number_field.rs b/crates/ui_input/src/number_field.rs index 2bc13fd2914b55449f3c6f5e3cec8f2ec08091ef..f6dc3349cddded1453a5c49270507783fd27ecd2 100644 --- a/crates/ui_input/src/number_field.rs +++ b/crates/ui_input/src/number_field.rs @@ -369,7 +369,6 @@ impl RenderOnce for NumberField { let new_value = value.saturating_sub(step); let new_value = if new_value < min { min } else { new_value }; on_change(&new_value, window, cx); - window.focus_prev(); } };