From 4e09491dd528100466f0dd62166c74c137f8c9d9 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Tue, 22 Mar 2022 02:07:19 +0100 Subject: [PATCH] Fix active state after text entry in a ParamSlider --- nih_plug_vizia/src/widgets/param_slider.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nih_plug_vizia/src/widgets/param_slider.rs b/nih_plug_vizia/src/widgets/param_slider.rs index c886fdb2..7c1afcbd 100644 --- a/nih_plug_vizia/src/widgets/param_slider.rs +++ b/nih_plug_vizia/src/widgets/param_slider.rs @@ -307,7 +307,8 @@ impl View for ParamSlider { if let Some(param_slider_event) = event.message.downcast() { match param_slider_event { ParamSliderEvent::CancelTextInput => { - cx.emit(ParamSliderInternalEvent::SetTextInputActive(false)) + cx.emit(ParamSliderInternalEvent::SetTextInputActive(false)); + cx.current.set_active(cx, false); } ParamSliderEvent::TextInput(string) => { if let Some(normalized_value) = @@ -318,7 +319,7 @@ impl View for ParamSlider { cx.emit(RawParamEvent::EndSetParameter(self.param_ptr)); } - cx.emit(ParamSliderInternalEvent::SetTextInputActive(false)) + cx.emit(ParamSliderInternalEvent::SetTextInputActive(false)); } } }