From bcfe4cea5686b977158f3568b4bef25fcccabcbb Mon Sep 17 00:00:00 2001 From: Matthias Alphart Date: Fri, 27 Dec 2024 00:34:40 +0100 Subject: [PATCH] Fix scroll reset of group address selector (#191) --- src/components/knx-group-address-selector.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/knx-group-address-selector.ts b/src/components/knx-group-address-selector.ts index 867ae3d..54e7714 100644 --- a/src/components/knx-group-address-selector.ts +++ b/src/components/knx-group-address-selector.ts @@ -88,6 +88,11 @@ export class GroupAddressSelector extends LitElement { this.addressOptions = getAddressOptions(this.filteredGroupAddresses); } + protected shouldUpdate(changedProps: PropertyValues) { + // ignore hass updates to avoid scrolling reset of open dropdowns (when input filter is set) + return !(changedProps.size === 1 && changedProps.has("hass")); + } + protected willUpdate(changedProps: PropertyValues) { if (changedProps.has("config")) { const selectedDPT = this.getValidDptFromConfigValue();