From f1faa043ad4c85dba341cd91589edf532cd9e17e Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 13 May 2021 10:23:42 +0800 Subject: [PATCH] bugfix --- src/base/single/editor/editor.textarea.js | 13 ++++++++++--- src/less/base/single/editor/editor.textarea.less | 4 +--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/base/single/editor/editor.textarea.js b/src/base/single/editor/editor.textarea.js index 388d12f48..29ca9589f 100644 --- a/src/base/single/editor/editor.textarea.js +++ b/src/base/single/editor/editor.textarea.js @@ -86,7 +86,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, { if (BI.isNotEmptyString(o.watermark)) { if (!this.watermark) { this.watermark = BI.createWidget({ - type: "bi.text_button", + type: "bi.label", cls: "bi-water-mark cursor-default textarea-watermark", textAlign: "left", whiteSpace: "normal", @@ -96,8 +96,15 @@ BI.TextAreaEditor = BI.inherit(BI.Single, { hgap: 4, vgap: 4 }); - this.watermark.on(BI.TextButton.EVENT_CHANGE, function () { - self.focus(); + this.watermark.element.bind({ + mousedown: function (e) { + if (self.isEnabled()) { + self.editor.focus(); + } else { + self.editor.blur(); + } + e.stopEvent(); + } }); BI.createWidget({ type: "bi.absolute", diff --git a/src/less/base/single/editor/editor.textarea.less b/src/less/base/single/editor/editor.textarea.less index bac545aac..2ba0dd548 100644 --- a/src/less/base/single/editor/editor.textarea.less +++ b/src/less/base/single/editor/editor.textarea.less @@ -10,8 +10,6 @@ & { border: none; } - // BI-86802 div构造的水印移上去没有输入状态的光标,让编辑框层级比水印高一点 - z-index: 1; } & .textarea-watermark{ max-height: 100%; @@ -26,4 +24,4 @@ } } } -} \ No newline at end of file +}