Etemplate: Fix some missing bits in searchbox

This commit is contained in:
nathangray 2021-03-25 11:21:45 -06:00
parent 8208c49637
commit 67ab00ad05
2 changed files with 10 additions and 2 deletions

View File

@ -101,7 +101,7 @@ var et2_textbox = /** @class */ (function (_super) {
};
et2_textbox.prototype.getValue = function () {
// only return "" for blur-value, if browser does not support html5 placeholder
if (this.options && this.options.blur &&
if (this.options && this.options.blur && this.input &&
!this.input[0].placeholder &&
this.input.val() == this.options.blur) {
return "";
@ -493,6 +493,10 @@ var et2_searchbox = /** @class */ (function (_super) {
this._searchToggleState();
_super.prototype.change.apply(this, arguments);
};
et2_searchbox.prototype.getInputNode = function () {
var _a;
return (_a = this.search) === null || _a === void 0 ? void 0 : _a.input.get(0);
};
et2_searchbox.prototype.get_value = function () {
return this.search.input.val();
};

View File

@ -162,7 +162,7 @@ export class et2_textbox extends et2_inputWidget implements et2_IResizeable
getValue()
{
// only return "" for blur-value, if browser does not support html5 placeholder
if (this.options && this.options.blur &&
if (this.options && this.options.blur && this.input &&
!(<HTMLInputElement>this.input[0]).placeholder &&
this.input.val() == this.options.blur)
{
@ -581,6 +581,10 @@ class et2_searchbox extends et2_textbox
super.change.apply(this,arguments);
}
getInputNode(): HTMLElement
{
return this.search?.input.get(0);
}
get_value()
{