From 7513e4426c7c9779bf9051bfa6a48d1df894f37d Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Sat, 25 Jan 2025 11:03:53 +0000 Subject: [PATCH] Allow text editor type=color for colours not in hex RGB format See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/color#value --- core/modules/editor/engines/simple.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/modules/editor/engines/simple.js b/core/modules/editor/engines/simple.js index 3c7f7d0c9..8bf8b3be2 100644 --- a/core/modules/editor/engines/simple.js +++ b/core/modules/editor/engines/simple.js @@ -91,6 +91,9 @@ Update the DomNode with the new text */ SimpleEngine.prototype.updateDomNodeText = function(text) { try { + if(this.widget.editType === "color") { + text = $tw.utils.convertRGBStringToCSSColor(text); + } this.domNode.value = text; } catch(e) { // Ignore