Merge pull request #6775 from penpot/superalex-fix-entering-long-project-name

🐛 Fix entering long project name
This commit is contained in:
Andrey Antukh 2025-06-26 10:48:54 +02:00 committed by GitHub
commit 34d65ed1c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 15 additions and 10 deletions

View file

@ -59,6 +59,7 @@ on-premises instances** that want to keep up to date.
- Fix snap nodes shortcut [Taiga #11054](https://tree.taiga.io/project/penpot/issue/11054)
- Fix changing a text property in a text layer does not unapply the previously applied token in the same property [Taiga #11337}(https://tree.taiga.io/project/penpot/issue/11337)
- Fix shortcut error pressing G+W from the View Mode [Taiga #11061](https://tree.taiga.io/project/penpot/issue/11061)
- Fix entering long project name [Taiga #11417](https://tree.taiga.io/project/penpot/issue/11417)
## 2.7.2

View file

@ -86,7 +86,8 @@
(when-not (str/empty? name)
(st/emit! (-> (dd/rename-project (assoc project :name name))
(with-meta {::ev/origin "project"}))))
(swap! local assoc :edition false)))}]
(swap! local assoc :edition false)))
:max-length 250}]
[:div {:class (stl/css :dashboard-title)}
[:h1 {:on-double-click on-edit
:data-testid "project-title"

View file

@ -414,7 +414,8 @@
[:div {:class (stl/css :item-info)}
(if (and (= file-id (:file-id state)) (:edition state))
[:& inline-edition {:content (:name file)
:on-end edit}]
:on-end edit
:max-length 250}]
[:h3 (:name file)])
[:& grid-item-metadata {:modified-at (:modified-at file)}]]

View file

@ -13,7 +13,7 @@
[rumext.v2 :as mf]))
(mf/defc inline-edition
[{:keys [content on-end] :as props}]
[{:keys [content on-end max-length] :as props}]
(let [name (mf/use-state content)
input-ref (mf/use-ref)
@ -61,13 +61,14 @@
(dom/select-text! node))))
[:div {:class (stl/css :edit-wrapper)}
[:input {:class (stl/css :element-title)
:value @name
:ref input-ref
:on-click on-click
:on-change on-input
[:input {:class (stl/css :element-title)
:value @name
:ref input-ref
:on-click on-click
:on-change on-input
:on-key-down on-keyup
:on-blur on-blur}]
:on-blur on-blur
:max-length max-length}]
[:span {:class (stl/css :close)
:on-click on-cancel} i/close]]))

View file

@ -220,7 +220,8 @@
[:div {:class (stl/css :project-name-wrapper)}
(if (:edition @local)
[:& inline-edition {:content (:name project)
:on-end on-edit}]
:on-end on-edit
:max-length 250}]
[:h2 {:on-click on-nav
:style {:max-width (str title-width "%")}
:class (stl/css :project-name)