From 528c508584ae4ff7d2d4f71d975e9ff326b440de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Lubiak?= Date: Sat, 19 Oct 2024 18:01:27 +0200 Subject: [PATCH] Fix `SliderWithCallback` not clamping the value before calling the callback --- src/ftxui/component/slider.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ftxui/component/slider.cpp b/src/ftxui/component/slider.cpp index 08858a9..9a2052f 100644 --- a/src/ftxui/component/slider.cpp +++ b/src/ftxui/component/slider.cpp @@ -421,7 +421,7 @@ public: bool Focusable() const final { return true; } void SetValue(Ref val) { - value_() = val(); + value_() = util::clamp(val(), min_(), max_()); callback_(value_()); }