From 57bfca4062423761e76fdf4acae9ead50d406acc Mon Sep 17 00:00:00 2001 From: Miguel de Benito Delgado Date: Sun, 26 Oct 2025 12:02:20 +0000 Subject: [PATCH] :bug: Maintain selection after font change --- frontend/src/app/util/text_editor.cljs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/util/text_editor.cljs b/frontend/src/app/util/text_editor.cljs index 8b7367a1c3..ab746f7393 100644 --- a/frontend/src/app/util/text_editor.cljs +++ b/frontend/src/app/util/text_editor.cljs @@ -101,8 +101,10 @@ (impl/updateBlockData state block-key (clj->js attrs))))) state (impl/applyInlineStyle state (legacy.txt/attrs-to-styles attrs)) - selected (impl/getSelectedBlocks state)] - (reduce update-blocks state selected))) + selection-after-apply (impl/getSelection state) + selected (impl/getSelectedBlocks state) + state (reduce update-blocks state selected)] + (impl/setSelection state selection-after-apply))) (defn update-editor-current-inline-styles-fn [state update-fn]