mirror of
https://github.com/penpot/penpot.git
synced 2026-08-05 20:38:38 +00:00
🐛 Fix Firefox not inserting emoji from MacOS Character Viewer (#11072)
This commit is contained in:
parent
6f2bfb617c
commit
1b26b69b25
@ -421,9 +421,15 @@
|
|||||||
|
|
||||||
on-blur
|
on-blur
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(fn [^js _event]
|
(fn [^js event]
|
||||||
(sync-wasm-text-editor-content! {:finalize? true})
|
;; MacOS Character Viewer on Firefox fires a `blur` when it opens.
|
||||||
(wasm.api/text-editor-blur)))
|
;; To avoid losing the selected character, we need guard against
|
||||||
|
;; `activeElement` being the surface itself.
|
||||||
|
(when-not (and (some? event)
|
||||||
|
(= (.-activeElement js/document)
|
||||||
|
(mf/ref-val contenteditable-ref)))
|
||||||
|
(sync-wasm-text-editor-content! {:finalize? true})
|
||||||
|
(wasm.api/text-editor-blur))))
|
||||||
|
|
||||||
style #js {:pointerEvents "all"
|
style #js {:pointerEvents "all"
|
||||||
"--editor-container-width" (dm/str width "px")
|
"--editor-container-width" (dm/str width "px")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user