diff --git a/src/base/single/editor/editor.js b/src/base/single/editor/editor.js index fb359f234..7ad107ff6 100644 --- a/src/base/single/editor/editor.js +++ b/src/base/single/editor/editor.js @@ -232,9 +232,9 @@ export class Editor extends Single { } _checkToolTip() { - const { errorText } = this.options; + let errorText = this.options.errorText; if (isFunction(errorText)) { - this.options.errorText = errorText(this.editor.getValue()); + errorText = errorText(this.editor.getValue()); } if (isKey(errorText)) { if (!this.isEnabled() || this.isValid() || Bubbles.has(this.getName())) { @@ -324,9 +324,10 @@ export class Editor extends Single { } _setErrorVisible(b) { - const { errorText, autoTrim, simple } = this.options; + const { autoTrim, simple } = this.options; + let errorText = this.options.errorText; if (isFunction(errorText)) { - this.options.errorText = errorText(autoTrim ? trim(this.editor.getValue()) : this.editor.getValue()); + errorText = errorText(autoTrim ? trim(this.editor.getValue()) : this.editor.getValue()); } if (!this.disabledError && isKey(errorText)) { Bubbles[b ? "show" : "hide"](this.getName(), errorText, this, {