🐛 Fix Firefox not inserting emoji from MacOS Character Viewer (#11072)

This commit is contained in:
Belén Albeza 2026-08-05 12:53:20 +02:00 committed by GitHub
parent 6f2bfb617c
commit 1b26b69b25
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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")