mirror of
https://github.com/penpot/penpot.git
synced 2025-06-07 05:51:39 +02:00
🐛 Stop drag events when the user focus out the application
This commit is contained in:
parent
054ffbe396
commit
895f649ef1
11 changed files with 53 additions and 80 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue