From c450c6133cc272a9871fc783926de9c0e6062d46 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 12 Aug 2025 14:31:18 +0200 Subject: [PATCH] editor: fix colorpicker dragend handler (dragend doesn't bubble up anymore, it needs to be caught for all 3 subwidgets) --- CHANGELOG.md | 1 + src/client/ui/ui-colorpicker.js | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 483f28bd..a109bdf2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - bug fixes - firefox: `onTouch` error when the cursor goes outside the page - dropdown: label not initialized until a value is set + - editor: regression (1.29.0) preventing color changes made with the color to be undoable unless validaed with the enter key - client - add `title` client option diff --git a/src/client/ui/ui-colorpicker.js b/src/client/ui/ui-colorpicker.js index 43e3cbbd..7e4c851b 100644 --- a/src/client/ui/ui-colorpicker.js +++ b/src/client/ui/ui-colorpicker.js @@ -37,10 +37,13 @@ class ColorPicker extends UiWidget { this.trigger('change', {preventHistory: true}) }) - this.rgb.on('dragend', (e)=>{ + var dragEndCb = (e)=>{ this.value = chroma(this.rgb.value).hex() this.trigger('change') - }) + } + this.rgb.pad.on('dragend', dragEndCb) + this.rgb.hue.on('dragend', dragEndCb) + this.rgb.alpha.on('dragend', dragEndCb) this.opened = 0