mirror of
https://github.com/penpot/penpot.git
synced 2025-02-14 11:09:04 -05:00
🐛 Fix text editor enter behaviour with centered texts
This commit is contained in:
parent
5a8ce52105
commit
efd2ad8f8b
3 changed files with 6 additions and 7 deletions
|
@ -16,6 +16,7 @@
|
||||||
- Fix undo problem when changing typography/color from library [#1230](https://github.com/penpot/penpot/issues/1230)
|
- Fix undo problem when changing typography/color from library [#1230](https://github.com/penpot/penpot/issues/1230)
|
||||||
- Fix problem with text margin while rendering [#1231](https://github.com/penpot/penpot/issues/1231)
|
- Fix problem with text margin while rendering [#1231](https://github.com/penpot/penpot/issues/1231)
|
||||||
- Fix problem with masked texts on exporting [Taiga #2116](https://tree.taiga.io/project/penpot/issue/2116)
|
- Fix problem with masked texts on exporting [Taiga #2116](https://tree.taiga.io/project/penpot/issue/2116)
|
||||||
|
- Fix text editor enter behaviour with centered texts [Taiga #2126](https://tree.taiga.io/project/penpot/issue/2126)
|
||||||
|
|
||||||
### :arrow_up: Deps updates
|
### :arrow_up: Deps updates
|
||||||
### :boom: Breaking changes
|
### :boom: Breaking changes
|
||||||
|
|
|
@ -180,12 +180,10 @@
|
||||||
shape (get objects id)
|
shape (get objects id)
|
||||||
|
|
||||||
merge-fn (fn [node attrs]
|
merge-fn (fn [node attrs]
|
||||||
(reduce-kv (fn [node k v]
|
(reduce-kv
|
||||||
(if (= (get node k) v)
|
(fn [node k v] (assoc node k v))
|
||||||
(dissoc node k)
|
node
|
||||||
(assoc node k v)))
|
attrs))
|
||||||
node
|
|
||||||
attrs))
|
|
||||||
|
|
||||||
update-fn #(update-shape % txt/is-paragraph-node? merge-fn attrs)
|
update-fn #(update-shape % txt/is-paragraph-node? merge-fn attrs)
|
||||||
shape-ids (cond (= (:type shape) :text) [id]
|
shape-ids (cond (= (:type shape) :text) [id]
|
||||||
|
|
|
@ -174,7 +174,7 @@
|
||||||
handle-return
|
handle-return
|
||||||
(mf/use-callback
|
(mf/use-callback
|
||||||
(fn [_ state]
|
(fn [_ state]
|
||||||
(let [style (ted/get-editor-current-inline-styles state)
|
(let [style (ted/get-editor-current-block-data state)
|
||||||
state (-> (ted/insert-text state "\n" style)
|
state (-> (ted/insert-text state "\n" style)
|
||||||
(handle-change))]
|
(handle-change))]
|
||||||
(st/emit! (dwt/update-editor-state shape state)))
|
(st/emit! (dwt/update-editor-state shape state)))
|
||||||
|
|
Loading…
Add table
Reference in a new issue