mirror of
https://github.com/penpot/penpot.git
synced 2026-09-11 14:39:35 +00:00
🐛 Fix text selection on Safari 18/26 (wasm)
This commit is contained in:
parent
153277d152
commit
e9d30bf2c1
@ -27,7 +27,7 @@
|
|||||||
;; --- Auxiliar Functions
|
;; --- Auxiliar Functions
|
||||||
|
|
||||||
(def valid-browsers
|
(def valid-browsers
|
||||||
#{:chrome :firefox :safari :safari-16 :safari-17 :edge :other})
|
#{:chrome :firefox :safari :safari-16 :safari-17 :safari-18 :safari-26 :edge :other})
|
||||||
|
|
||||||
(def valid-platforms
|
(def valid-platforms
|
||||||
#{:windows :linux :macos :other})
|
#{:windows :linux :macos :other})
|
||||||
@ -40,13 +40,17 @@
|
|||||||
check-edge? (fn [] (str/includes? user-agent "edg"))
|
check-edge? (fn [] (str/includes? user-agent "edg"))
|
||||||
check-safari? (fn [] (str/includes? user-agent "safari"))
|
check-safari? (fn [] (str/includes? user-agent "safari"))
|
||||||
check-safari-16? (fn [] (and (check-safari?) (str/includes? user-agent "version/16")))
|
check-safari-16? (fn [] (and (check-safari?) (str/includes? user-agent "version/16")))
|
||||||
check-safari-17? (fn [] (and (check-safari?) (str/includes? user-agent "version/17")))]
|
check-safari-17? (fn [] (and (check-safari?) (str/includes? user-agent "version/17")))
|
||||||
|
check-safari-18? (fn [] (and (check-safari?) (str/includes? user-agent "version/18")))
|
||||||
|
check-safari-26? (fn [] (and (check-safari?) (str/includes? user-agent "version/26")))]
|
||||||
(cond
|
(cond
|
||||||
^boolean (check-edge?) :edge
|
^boolean (check-edge?) :edge
|
||||||
^boolean (check-chrome?) :chrome
|
^boolean (check-chrome?) :chrome
|
||||||
^boolean (check-firefox?) :firefox
|
^boolean (check-firefox?) :firefox
|
||||||
^boolean (check-safari-16?) :safari-16
|
^boolean (check-safari-16?) :safari-16
|
||||||
^boolean (check-safari-17?) :safari-17
|
^boolean (check-safari-17?) :safari-17
|
||||||
|
^boolean (check-safari-18?) :safari-18
|
||||||
|
^boolean (check-safari-26?) :safari-26
|
||||||
^boolean (check-safari?) :safari
|
^boolean (check-safari?) :safari
|
||||||
:else :unknown)))
|
:else :unknown)))
|
||||||
|
|
||||||
|
|||||||
@ -364,7 +364,7 @@
|
|||||||
;; NOTE: this teoretically breaks hooks rules, but in practice
|
;; NOTE: this teoretically breaks hooks rules, but in practice
|
||||||
;; it is imposible to really break it
|
;; it is imposible to really break it
|
||||||
maybe-zoom
|
maybe-zoom
|
||||||
(when (cf/check-browser? :safari-16)
|
(when (or (cf/check-browser? :safari) (cf/check-browser? :safari-26) (cf/check-browser? :safari-18))
|
||||||
(mf/deref refs/selected-zoom))
|
(mf/deref refs/selected-zoom))
|
||||||
|
|
||||||
shape (cond-> shape
|
shape (cond-> shape
|
||||||
@ -420,17 +420,23 @@
|
|||||||
;; Transform is necessary when there is a text overflow and the vertical
|
;; Transform is necessary when there is a text overflow and the vertical
|
||||||
;; aligment is center or bottom.
|
;; aligment is center or bottom.
|
||||||
(and (not render-wasm?)
|
(and (not render-wasm?)
|
||||||
(not (cf/check-browser? :safari)))
|
(not (cf/check-browser? :safari-16)))
|
||||||
(obj/merge!
|
(obj/merge!
|
||||||
#js {:transform (dm/fmt "translate(%px, %px)" (- (dm/get-prop shape :x) x) (- (dm/get-prop shape :y) y))})
|
#js {:transform (dm/fmt "translate(%px, %px)" (- (dm/get-prop shape :x) x) (- (dm/get-prop shape :y) y))})
|
||||||
|
|
||||||
(cf/check-browser? :safari-17)
|
(or (cf/check-browser? :safari-18) (cf/check-browser? :safari-26) (cf/check-browser? :safari-17))
|
||||||
(obj/merge!
|
(obj/merge!
|
||||||
#js {:height "100%"
|
#js {:height "100%"
|
||||||
:display "flex"
|
:display "flex"
|
||||||
:flexDirection "column"
|
:flexDirection "column"
|
||||||
:justifyContent (shape->justify shape)})
|
:justifyContent (shape->justify shape)})
|
||||||
|
|
||||||
|
(or (cf/check-browser? :safari-26) (cf/check-browser? :safari-18))
|
||||||
|
(obj/merge!
|
||||||
|
#js {:position "fixed"
|
||||||
|
:transform-origin "top left"
|
||||||
|
:transform (dm/fmt "scale(%)" maybe-zoom)})
|
||||||
|
|
||||||
(cf/check-browser? :safari-16)
|
(cf/check-browser? :safari-16)
|
||||||
(obj/merge!
|
(obj/merge!
|
||||||
#js {:position "fixed"
|
#js {:position "fixed"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user