Skip to content

Commit 665bea5

Browse files
committed
feat(pat tooltip): Initialize the tooltip's content after each refresh via get_content. This re-initializes any patterns after an update to the tooltip's contents.
1 parent fe0f0d7 commit 665bea5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/pat/tooltip/tooltip.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,11 @@ export default Base.extend({
262262

263263
async _onMount() {
264264
if (this.options.source === "ajax") {
265-
await this.get_content();
265+
await this.get_content(); // + _initializeContent
266+
} else {
267+
this._initializeContent();
266268
}
267269

268-
this._initializeContent();
269-
270270
// Notify parent patterns about injected content.
271271
// Do not call pat-inject's handler, because all necessary
272272
// initialization after injection is done here.
@@ -349,6 +349,7 @@ export default Base.extend({
349349
this.tippy.setContent(content);
350350
await utils.timeout(1); // Wait a tick before forceUpdate. Might fail due to unset popperInstance.
351351
this.tippy.popperInstance.forceUpdate(); // re-position tippy after content is known.
352+
this._initializeContent();
352353
}
353354
},
354355

0 commit comments

Comments
 (0)