Skip to content

Commit 2cf17b1

Browse files
committed
fix wrong call order
1 parent dfc1391 commit 2cf17b1

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

web_src/js/webcomponents/overflow-menu.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ window.customElements.define('overflow-menu', class extends HTMLElement {
115115
const btn = this.querySelector('.overflow-menu-button');
116116
btn?._tippy?.destroy();
117117
btn?.remove();
118+
this.button = null;
118119
return;
119120
}
120121

@@ -139,15 +140,12 @@ window.customElements.define('overflow-menu', class extends HTMLElement {
139140
}
140141

141142
// create button initially
142-
const btn = document.createElement('button');
143-
btn.classList.add('overflow-menu-button');
144-
btn.setAttribute('aria-label', window.config.i18n.more_items);
145-
btn.innerHTML = octiconKebabHorizontal;
146-
this.append(btn);
147-
this.button = btn;
148-
this.updateButtonActivationState();
149-
150-
createTippy(btn, {
143+
this.button = document.createElement('button');
144+
this.button.classList.add('overflow-menu-button');
145+
this.button.setAttribute('aria-label', window.config.i18n.more_items);
146+
this.button.innerHTML = octiconKebabHorizontal;
147+
this.append(this.button);
148+
createTippy(this.button, {
151149
trigger: 'click',
152150
hideOnClick: true,
153151
interactive: true,
@@ -161,6 +159,7 @@ window.customElements.define('overflow-menu', class extends HTMLElement {
161159
}, 0);
162160
},
163161
});
162+
this.updateButtonActivationState();
164163
});
165164

166165
init() {

0 commit comments

Comments
 (0)