diff --git a/CHANGES.md b/CHANGES.md index 31f97d2092..b65547a629 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -25,7 +25,6 @@ - Hide bounding box while editing visual effects [Taiga #11576](https://tree.taiga.io/project/penpot/issue/11576) - Improved text layer resizing: Allow double-click on text bounding box to set auto-width/auto-height [Taiga #11577](https://tree.taiga.io/project/penpot/issue/11577) - Improve text layer auto-resize: auto-width switches to auto-height on horizontal resize, and only switches to fixed on vertical resize [Taiga #11578](https://tree.taiga.io/project/penpot/issue/11578) -- Highlight first font in font selector search. Apply only on Enter or click. [Taiga #11579](https://tree.taiga.io/project/penpot/issue/11579) - Add the ability to show login dialog on profile settings [Github #6871](https://github.com/penpot/penpot/pull/6871) - Improve the application of tokens with object specific tokens [Taiga #10209](https://tree.taiga.io/project/penpot/us/10209) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/typography.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/typography.cljs index 92fab80bad..6f4db43e23 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/typography.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/typography.cljs @@ -112,6 +112,7 @@ recent-fonts (mf/with-memo [state recent-fonts] (filter-fonts state recent-fonts)) + full-size? (boolean (and full-size show-recent)) select-next @@ -130,13 +131,6 @@ (dom/prevent-default event) (swap! selected get-prev-font fonts))) - on-select-and-close - (mf/use-fn - (mf/deps on-select on-close) - (fn [font] - (on-select font) - (on-close))) - on-key-down (mf/use-fn (mf/deps fonts) @@ -145,7 +139,7 @@ (kbd/up-arrow? event) (select-prev event) (kbd/down-arrow? event) (select-next event) (kbd/esc? event) (on-close) - (kbd/enter? event) (do (on-select-and-close @selected)) + (kbd/enter? event) (on-close) :else (dom/focus! (mf/ref-val input))))) on-filter-change @@ -169,6 +163,9 @@ (when-let [index (:index @selected)] (.scrollToRow ^js inst index)))) + (mf/with-effect [@selected] + (on-select @selected)) + (mf/with-effect [] (st/emit! (dsc/push-shortcuts :typography {})) (fn [] @@ -181,10 +178,6 @@ #(let [offset (.getOffsetForRow ^js inst #js {:alignment "center" :index index})] (.scrollToPosition ^js inst offset))))) - (mf/with-effect [(:term state) fonts] - (when (and (seq fonts) (not= (:id @selected) (:id (first fonts)))) - (reset! selected (first fonts)))) - [:div {:class (stl/css :font-selector)} [:div {:class (stl/css-case :font-selector-dropdown true :font-selector-dropdown-full-size full-size?)} [:div {:class (stl/css :header)}