From 1873e175be55ff46bc3164b6961c7f8e7a172b93 Mon Sep 17 00:00:00 2001 From: hengsin Date: Tue, 21 Jun 2022 13:06:28 +0800 Subject: [PATCH] IDEMPIERE-5321 Color editor not working on Chrome (#1370) --- .../adempiere/webui/editor/WColorEditor.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WColorEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WColorEditor.java index 2f92999fb5..b996e27d67 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WColorEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WColorEditor.java @@ -103,9 +103,22 @@ public class WColorEditor extends WEditor implements ContextMenuListener + "border:none !important;margin:0 !important;padding:0 !important;visibility:hidden;"); getComponent().appendChild(colorbox); - colorbox.addEventListener(Events.ON_CHANGE, e -> { - processNewValue(colorbox.getValue()); + colorbox.addEventListener("onInput", e -> { + processNewValue((String)e.getData()); }); + + colorbox.setWidgetOverride("__doOnInput", "function(evt) {" + + " let v=this.$n().value;" + + " this.fire('onInput',v,{toServer:true});" + + "}"); + colorbox.setWidgetOverride("bind_", "function() {" + + " this.$supers('bind_',arguments);" + + " this.domListen_(this.$n(),'oninput','__doOnInput');" + + "}"); + colorbox.setWidgetOverride("unbind_", "function() {" + + " this.domUnlisten_(this.$n(),'oninput','__doOnInput');" + + " this.$supers('unbind_',arguments);" + + "}"); } private void init()