Skip to content

Commit

Permalink
Fix scroll reset of group address selector (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
farmio authored Dec 26, 2024
1 parent 1da47f1 commit bcfe4ce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/knx-group-address-selector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ export class GroupAddressSelector extends LitElement {
this.addressOptions = getAddressOptions(this.filteredGroupAddresses);
}

protected shouldUpdate(changedProps: PropertyValues<this>) {
// 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<this>) {
if (changedProps.has("config")) {
const selectedDPT = this.getValidDptFromConfigValue();
Expand Down

0 comments on commit bcfe4ce

Please sign in to comment.