diff --git a/CHANGES.md b/CHANGES.md index 24d02dc4e6..6fa4cb93d0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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) diff --git a/frontend/src/app/main/ui/workspace/colorpicker.cljs b/frontend/src/app/main/ui/workspace/colorpicker.cljs index 147aa74991..bb40c905c3 100644 --- a/frontend/src/app/main/ui/workspace/colorpicker.cljs +++ b/frontend/src/app/main/ui/workspace/colorpicker.cljs @@ -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 diff --git a/frontend/src/app/main/ui/workspace/colorpicker/gradients.cljs b/frontend/src/app/main/ui/workspace/colorpicker/gradients.cljs index 6ebfc2a1d1..9e9eae0a19 100644 --- a/frontend/src/app/main/ui/workspace/colorpicker/gradients.cljs +++ b/frontend/src/app/main/ui/workspace/colorpicker/gradients.cljs @@ -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