🐛 Fix remove color button in the gradient editor (#6942)

This commit is contained in:
Alejandro Alonso 2025-07-23 09:04:54 +02:00 committed by GitHub
parent 4effd375a9
commit d46b519524
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions

View file

@ -43,6 +43,7 @@
- Fix duplicating pages with mainInstance shapes nested inside groups [Taiga #10774](https://tree.taiga.io/project/penpot/issue/10774)
- Fix ESC key not closing Add/Manage Libraries modal [Taiga #11523](https://tree.taiga.io/project/penpot/issue/11523)
- Fix copying a shadow color from info tab [Taiga #11211](https://tree.taiga.io/project/penpot/issue/11211)
- Fix remove color button in the gradient editor [Taiga #11623](https://tree.taiga.io/project/penpot/issue/11623)
## 2.8.1 (Unreleased)

View file

@ -276,10 +276,9 @@
handle-gradient-remove-stop
(mf/use-fn
(mf/deps state)
(fn [stop]
(fn [index]
(when (> (count (:stops state)) 2)
(when-let [index (d/index-of-pred (:stops state) #(= % stop))]
(st/emit! (dc/remove-gradient-stop index))))))
(st/emit! (dc/remove-gradient-stop index)))))
handle-stop-edit-start
(mf/use-fn

View file

@ -80,10 +80,10 @@
handle-remove-stop
(mf/use-callback
(mf/deps on-remove-stop stop)
(mf/deps on-remove-stop index)
(fn []
(when on-remove-stop
(on-remove-stop stop))))
(on-remove-stop index))))
handle-focus-stop-offset
(mf/use-fn