Skip to content

Commit 9312ae9

Browse files
committed
Use @query
1 parent 377747e commit 9312ae9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/panels/config/automation/sidebar/ha-automation-sidebar-card.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ export default class HaAutomationSidebarCard extends LitElement {
4949

5050
@query(".card-content") private _contentElement!: HTMLDivElement;
5151

52+
@query("ha-dialog-header") private _headerElement?: HTMLElement;
53+
5254
private _contentSize = new ResizeController(this, {
5355
target: null,
5456
callback: (entries) => {
@@ -154,7 +156,7 @@ export default class HaAutomationSidebarCard extends LitElement {
154156

155157
private _updateHeaderHeight() {
156158
requestAnimationFrame(() => {
157-
const header = this.shadowRoot?.querySelector("ha-dialog-header");
159+
const header = this._headerElement;
158160
if (header) {
159161
const headerHeight = header.offsetHeight;
160162
this.style.setProperty(

0 commit comments

Comments
 (0)