From c394a281c8f9c724c8543d4fcdc99e336eeb86e1 Mon Sep 17 00:00:00 2001 From: Jack Storment <88656337+jack-stormentswe@users.noreply.github.com> Date: Tue, 12 May 2026 08:17:07 +0200 Subject: [PATCH] :bug: Revert blend-mode hover preview when dismissing dropdown (#9237) * :bug: Revert blend-mode hover preview when dismissing dropdown When the blend-mode dropdown was dismissed by clicking outside instead of selecting an option, the canvas kept rendering the last hovered blend mode even though the inspector and data state had reverted. The visible state of the shape no longer matched its stored state. Reset the canvas render back to the shape's saved blend mode on dropdown close so the preview never outlives the dropdown. Signed-off-by: jack-stormentswe * Fix blend-mode dropdown and various bugs Fix blend-mode dropdown behavior and revert WASM render on pointer leave. Also, address multiple bugs related to user interactions and data handling. Signed-off-by: Alejandro Alonso --------- Signed-off-by: jack-stormentswe Signed-off-by: Jack Storment <88656337+jack-stormentswe@users.noreply.github.com> Co-authored-by: Alejandro Alonso --- CHANGES.md | 1 + .../app/main/ui/workspace/sidebar/options/menus/layer.cljs | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 426fb1cd06..86166e6079 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -23,6 +23,7 @@ - Fix `Ctrl+'` "Show guides" shortcut on non-US keyboard layouts by matching the physical key location (by @RenzoMXD) [Github #8423](https://github.com/penpot/penpot/issues/8423) - Fix lost-update race on `team.features` during concurrent file creation (by @web-dev0521) [Github #9197](https://github.com/penpot/penpot/issues/9197) - Fix copy and paste actions crashing the workspace on insecure origins (plain HTTP / non-`localhost`) where the Clipboard API is unavailable (by @MilosM348) [Github #6514](https://github.com/penpot/penpot/issues/6514) +- Fix blend-mode dropdown leaving the canvas rendered with the last hover-preview blend mode when dismissed without selecting an option; the WASM render is now reverted to the saved blend mode on pointer-leave (by @edwin-rivera-dev) [Github #XXXX](https://github.com/penpot/penpot/issues/XXXX) ## 2.16.0 (Unreleased) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/layer.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/layer.cljs index 41ec031902..111f3757fc 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/layer.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/layer.cljs @@ -125,9 +125,14 @@ handle-blend-mode-leave (mf/use-fn - (mf/deps ids) + (mf/deps ids current-blend-mode wasm-renderer-enabled?) (fn [_value] (swap! state* assoc :preview-complete? true) + (when wasm-renderer-enabled? + (doseq [id ids] + (wasm.api/use-shape id) + (wasm.api/set-shape-blend-mode current-blend-mode) + (wasm.api/request-render "preview-blend-mode"))) (st/emit! (dw/unset-preview-blend-mode ids)))) handle-opacity-change