🐛 Stop drag events when the user focus out the application

This commit is contained in:
alonso.torres 2024-03-15 14:01:37 +01:00
parent 054ffbe396
commit 895f649ef1
11 changed files with 53 additions and 80 deletions

View file

@ -193,9 +193,7 @@
(watch [_ state stream]
(let [initial-pos @ms/mouse-position
selected (wsh/lookup-selected state)
stopper (->> stream
(rx/filter mse/mouse-event?)
(rx/filter mse/mouse-up-event?))]
stopper (mse/drag-stopper stream)]
(when (= 1 (count selected))
(rx/concat
(->> ms/mouse-position
@ -305,9 +303,7 @@
(watch [_ state stream]
(let [initial-pos @ms/mouse-position
selected (wsh/lookup-selected state)
stopper (->> stream
(rx/filter mse/mouse-event?)
(rx/filter mse/mouse-up-event?))]
stopper (mse/drag-stopper stream)]
(when (= 1 (count selected))
(let [page-id (:current-page-id state)
objects (wsh/lookup-page-objects state page-id)