Fixed a few issues with the search select component.

This commit is contained in:
MattMo 2023-10-24 18:04:36 -07:00
parent 7a4e43979c
commit 18901d2115

View File

@ -29,10 +29,15 @@ class SearchSelect extends IgniteElement {
render() { render() {
return this.template return this.template
.class("w-100 position-relative form-control form-control-lg d-flex flex-row justify-content-between") .class("w-100 position-relative form-control form-control-lg d-flex flex-row justify-content-between align-items-center")
.attribute("tabindex", "0") .attribute("tabindex", "0")
.onFocus(() => this.onFocus()) .onFocus(() => this.onFocus())
.child( .child(
//Search icon
new button()
.class("btn btn-none ps-0")
.child(new i().class("fa-solid fa-magnifying-glass")),
//Placeholder //Placeholder
new div() new div()
.hide([this.value, this.searching], (value, searching) => value || searching) .hide([this.value, this.searching], (value, searching) => value || searching)
@ -181,7 +186,9 @@ class SearchSelect extends IgniteElement {
search(text) { search(text) {
var results = []; var results = [];
results = results.concat(this.options); if (this.options) {
results = results.concat(this.options);
}
if (text && text != "" && text != " ") { if (text && text != "" && text != " ") {
var regex = new RegExp(text, 'i'); var regex = new RegExp(text, 'i');