Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/components/data-table/ha-data-table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,9 @@ export class HaDataTable extends LitElement {
}

private _handleSearchChange(ev: CustomEvent): void {
if (this.filter) {
return;
}
this._debounceSearch(ev.detail.value);
}

Expand Down
3 changes: 3 additions & 0 deletions src/layouts/hass-tabs-subpage-data-table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ export class HaTabsSubpageDataTable extends LitElement {
}

private _handleSearchChange(ev: CustomEvent) {
if (this.filter === ev.detail.value) {
return;
}
this.filter = ev.detail.value;
fireEvent(this, "search-changed", { value: this.filter });
}
Expand Down
3 changes: 2 additions & 1 deletion src/panels/config/devices/ha-config-devices-dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class HaConfigDeviceDashboard extends LitElement {

@state() private _showDisabled = false;

@state() private _filter = "";
@state() private _filter: string = history.state?.filter || "";

@state() private _numHiddenDevices = 0;

Expand Down Expand Up @@ -490,6 +490,7 @@ export class HaConfigDeviceDashboard extends LitElement {

private _handleSearchChange(ev: CustomEvent) {
this._filter = ev.detail.value;
history.replaceState({ filter: this._filter }, "");
}

private _clearFilter() {
Expand Down
3 changes: 2 additions & 1 deletion src/panels/config/entities/ha-config-entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) {

@state() private _showReadOnly = true;

@state() private _filter = "";
@state() private _filter: string = history.state?.filter || "";

@state() private _numHiddenEntities = 0;

Expand Down Expand Up @@ -711,6 +711,7 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) {

private _handleSearchChange(ev: CustomEvent) {
this._filter = ev.detail.value;
history.replaceState({ filter: this._filter }, "");
}

private _handleSelectionChanged(
Expand Down
3 changes: 2 additions & 1 deletion src/panels/config/integrations/ha-config-integrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class HaConfigIntegrations extends SubscribeMixin(LitElement) {
window.location.hash.substring(1)
);

@state() private _filter?: string;
@state() private _filter: string = history.state?.filter || "";

@state() private _diagnosticHandlers?: Record<string, boolean>;

Expand Down Expand Up @@ -613,6 +613,7 @@ class HaConfigIntegrations extends SubscribeMixin(LitElement) {

private _handleSearchChange(ev: CustomEvent) {
this._filter = ev.detail.value;
history.replaceState({ filter: this._filter }, "");
}

private async _highlightEntry() {
Expand Down