From 9021220f14a147a50112da4afae4a06effa7d1f9 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 29 Oct 2020 11:00:45 +0100 Subject: [PATCH] only return "" for blur-value, if browser does not support html5 placeholder --- api/js/etemplate/et2_widget_textbox.js | 6 +++++- api/js/etemplate/et2_widget_textbox.ts | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/api/js/etemplate/et2_widget_textbox.js b/api/js/etemplate/et2_widget_textbox.js index 9f8653bfcf..cba13db0f3 100644 --- a/api/js/etemplate/et2_widget_textbox.js +++ b/api/js/etemplate/et2_widget_textbox.js @@ -99,8 +99,12 @@ var et2_textbox = /** @class */ (function (_super) { _super.prototype.destroy.call(this); }; et2_textbox.prototype.getValue = function () { - if (this.options && this.options.blur && this.input.val() == this.options.blur) + // only return "" for blur-value, if browser does not support html5 placeholder + if (this.options && this.options.blur && + !this.input[0].placeholder && + this.input.val() == this.options.blur) { return ""; + } return _super.prototype.getValue.call(this); }; /** diff --git a/api/js/etemplate/et2_widget_textbox.ts b/api/js/etemplate/et2_widget_textbox.ts index 319203476f..c6e6daa27a 100644 --- a/api/js/etemplate/et2_widget_textbox.ts +++ b/api/js/etemplate/et2_widget_textbox.ts @@ -161,7 +161,13 @@ export class et2_textbox extends et2_inputWidget implements et2_IResizeable getValue() { - if(this.options && this.options.blur && this.input.val() == this.options.blur) return ""; + // only return "" for blur-value, if browser does not support html5 placeholder + if (this.options && this.options.blur && + !(this.input[0]).placeholder && + this.input.val() == this.options.blur) + { + return ""; + } return super.getValue(); }