private readonly noResultPlaceholder: string;
private readonly preventSubmit: boolean;
private request?: AjaxRequest = undefined;
+ private readonly suppressErrors: boolean;
private timerDelay?: number = undefined;
/**
minLength: 3,
noResultPlaceholder: "",
preventSubmit: false,
+ suppressErrors: false,
},
options,
) as SearchInputOptions;
this.minLength = options.minLength!;
this.noResultPlaceholder = options.noResultPlaceholder!;
this.preventSubmit = options.preventSubmit!;
+ this.suppressErrors = options.suppressErrors || false;
// Disable auto-complete because it collides with the suggestion dropdown.
this.element.autocomplete = "off";
_ajaxSetup(): ReturnType<AjaxCallbackSetup> {
return {
data: this.ajaxPayload,
+ silent: this.suppressErrors,
};
}
}
noResultPlaceholder;
preventSubmit;
request = undefined;
+ suppressErrors;
timerDelay = undefined;
/**
* Initializes the search input field.
minLength: 3,
noResultPlaceholder: "",
preventSubmit: false,
+ suppressErrors: false,
}, options);
this.ajaxPayload = options.ajax;
this.autoFocus = options.autoFocus;
this.minLength = options.minLength;
this.noResultPlaceholder = options.noResultPlaceholder;
this.preventSubmit = options.preventSubmit;
+ this.suppressErrors = options.suppressErrors || false;
// Disable auto-complete because it collides with the suggestion dropdown.
this.element.autocomplete = "off";
this.element.addEventListener("keydown", (ev) => this.keydown(ev));
_ajaxSetup() {
return {
data: this.ajaxPayload,
+ silent: this.suppressErrors,
};
}
}