diff --git a/lib/datadistributor.ts b/lib/datadistributor.ts index 6c8e10fe..c6043748 100644 --- a/lib/datadistributor.ts +++ b/lib/datadistributor.ts @@ -67,11 +67,13 @@ export const DataDistributor = function () { refresh(); } - function refresh() { + function refresh(withoutObservers?: boolean) { if (data === undefined) { return; } - notifyObservers(); + if (!withoutObservers) { + notifyObservers(); + } let filter: FilterMethod = filters.reduce( function (a: FilterMethod, filter) { diff --git a/lib/filters/hostname.ts b/lib/filters/hostname.ts index cb62368e..a18ab749 100644 --- a/lib/filters/hostname.ts +++ b/lib/filters/hostname.ts @@ -4,7 +4,7 @@ import { CanRender } from "../container.js"; import { Filter } from "../datadistributor.js"; export const HostnameFilter = function (): CanRender & Filter { - let refreshFunctions: (() => any)[] = []; + let refreshFunctions: ((bool?) => any)[] = []; let timer: ReturnType; let input = document.createElement("input"); @@ -12,7 +12,9 @@ export const HostnameFilter = function (): CanRender & Filter { clearTimeout(timer); timer = setTimeout(function () { refreshFunctions.forEach(function (f) { - f(); + // observer gui function recreates the filter this removes the input focus + // the hostname filter should therefore not notifyObservers on refresh + f(true); }); }, 250); }