mirror of
https://github.com/penpot/penpot.git
synced 2025-01-24 15:39:50 -05:00
🐛 Fixes problem when pasting URL's from the browser address bar
This commit is contained in:
parent
0a6e0d0f2c
commit
42a55015fa
2 changed files with 11 additions and 3 deletions
|
@ -26,6 +26,7 @@
|
||||||
- Fix apply a color to a text selection from color palette was not working
|
- Fix apply a color to a text selection from color palette was not working
|
||||||
- Fix logo icon in viewer should go to dashboard
|
- Fix logo icon in viewer should go to dashboard
|
||||||
- Fix text alignment in preview [#594](https://github.com/penpot/penpot/issues/594)
|
- Fix text alignment in preview [#594](https://github.com/penpot/penpot/issues/594)
|
||||||
|
- Fix problem when pasting URL's copied from the browser url bar
|
||||||
|
|
||||||
### Community contributions by (Thank you! :heart:)
|
### Community contributions by (Thank you! :heart:)
|
||||||
|
|
||||||
|
|
|
@ -1481,11 +1481,16 @@
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [_ state stream]
|
(watch [_ state stream]
|
||||||
(try
|
(try
|
||||||
(let [paste-data (wapi/read-from-paste-event event)
|
(let [objects (dwc/lookup-page-objects state)
|
||||||
|
paste-data (wapi/read-from-paste-event event)
|
||||||
image-data (wapi/extract-images paste-data)
|
image-data (wapi/extract-images paste-data)
|
||||||
text-data (wapi/extract-text paste-data)
|
text-data (wapi/extract-text paste-data)
|
||||||
decoded-data (and (t/transit? text-data)
|
decoded-data (and (t/transit? text-data)
|
||||||
(t/decode text-data))]
|
(t/decode text-data))
|
||||||
|
|
||||||
|
edit-id (get-in state [:workspace-local :edition])
|
||||||
|
is-editing-text? (and edit-id (= :text (get-in objects [edit-id :type])))]
|
||||||
|
|
||||||
(cond
|
(cond
|
||||||
(seq image-data)
|
(seq image-data)
|
||||||
(rx/from (map paste-image image-data))
|
(rx/from (map paste-image image-data))
|
||||||
|
@ -1495,7 +1500,9 @@
|
||||||
(rx/filter #(= :copied-shapes (:type %)))
|
(rx/filter #(= :copied-shapes (:type %)))
|
||||||
(rx/map #(paste-shape % in-viewport?)))
|
(rx/map #(paste-shape % in-viewport?)))
|
||||||
|
|
||||||
(string? text-data)
|
;; Some paste events can be fired while we're editing a text
|
||||||
|
;; we forbid that scenario so the default behaviour is executed
|
||||||
|
(and (string? text-data) (not is-editing-text?))
|
||||||
(rx/of (paste-text text-data))
|
(rx/of (paste-text text-data))
|
||||||
|
|
||||||
:else
|
:else
|
||||||
|
|
Loading…
Add table
Reference in a new issue