Skip to content

Commit

Permalink
fix: select & tab-bar, trigger slotchange on hydration
Browse files Browse the repository at this point in the history
  • Loading branch information
faselbaum committed Jun 20, 2024
1 parent 85239e4 commit 1e9cac4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/ui-library/src/components/select/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { html, nothing } from 'lit';
import { PropertyValueMap, html, nothing } from 'lit';
import { classMap } from 'lit/directives/class-map.js';
import { query, state } from 'lit/decorators.js';
import { property } from '../../utils/lit/decorators.js';
Expand Down Expand Up @@ -82,6 +82,10 @@ export class BlrSelect extends LitElementCustom {
}
};

protected firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {

Check failure on line 85 in packages/ui-library/src/components/select/index.ts

View workflow job for this annotation

GitHub Actions / eslint

'_changedProperties' is defined but never used

Check failure on line 85 in packages/ui-library/src/components/select/index.ts

View workflow job for this annotation

GitHub Actions / eslint

Unexpected any. Specify a different type
this.handleSlotChange();
}

protected handleSlotChange() {
const slot = this.renderRoot?.querySelector('slot');

Expand Down
6 changes: 5 additions & 1 deletion packages/ui-library/src/components/tab-bar/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable lit/binding-positions */
import { html, nothing } from 'lit';
import { PropertyValueMap, html, nothing } from 'lit';
import { classMap } from 'lit/directives/class-map.js';
import { query, queryAll, state } from 'lit/decorators.js';
import { property } from '../../utils/lit/decorators.js';
Expand Down Expand Up @@ -94,6 +94,10 @@ export class BlrTabBar extends LitElementCustom {
}
}

protected firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {

Check failure on line 97 in packages/ui-library/src/components/tab-bar/index.ts

View workflow job for this annotation

GitHub Actions / eslint

'_changedProperties' is defined but never used

Check failure on line 97 in packages/ui-library/src/components/tab-bar/index.ts

View workflow job for this annotation

GitHub Actions / eslint

Unexpected any. Specify a different type
this.handleSlotChange();
}

protected handleSlotChange() {
const slot = this.renderRoot?.querySelector('slot');

Expand Down

0 comments on commit 1e9cac4

Please sign in to comment.