From 36c3ec81ffa8172904fb6098102f9e5e427efd75 Mon Sep 17 00:00:00 2001
From: Mora Unie Youer <mora_unie_youer@riseup.net>
Date: Sun, 2 Mar 2025 21:59:10 +0300
Subject: fix: audio volume slider freeze

---
 widget/bar/Bar.tsx | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

(limited to 'widget/bar/Bar.tsx')

diff --git a/widget/bar/Bar.tsx b/widget/bar/Bar.tsx
index 7492708..353eddf 100644
--- a/widget/bar/Bar.tsx
+++ b/widget/bar/Bar.tsx
@@ -66,14 +66,10 @@ function AudioVolume() {
 
   return <box cssClasses={["AudioVolume"]}>
     <image iconName={bind(speaker, "volumeIcon")} />
-    {/* {bind(speaker, "volume")} */}
     <slider
       hexpand
       onScroll={(_self, dx, dy) => speaker.volume += (dx + dy) * -0.05}
-      // BUG: this doesn't work due to value being updated immediately with dragging
-      // so that new value is never reached (slider "freezes")
-      // onChangeValue={({ value }) => new_volume = value}
-      // onKeyReleased={() => speaker.volume = new_volume}
+      onChangeValue={self => { speaker.volume = self.value; }}
       value={bind(speaker, "volume")}
     />
   </box>;
-- 
cgit v1.2.3-70-g09d2

