Skip to content

Commit

Permalink
fix(esl-tooltip): add constraints to fix DOM position management for …
Browse files Browse the repository at this point in the history
…`esl-tooltip`
  • Loading branch information
ala-n committed Dec 14, 2023
1 parent 27bd588 commit 9c25137
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/modules/esl-tooltip/core/esl-tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export class ESLTooltip extends ESLPopup {
}
this.dir = params.dir || '';
this.lang = params.lang || '';
document.body.appendChild(this);
this.parentNode !== document.body && document.body.appendChild(this);
super.onShow(params);
this._updateActivatorState(true);
}
Expand All @@ -106,7 +106,7 @@ export class ESLTooltip extends ESLPopup {
public override onHide(params: TooltipActionParams): void {
this._updateActivatorState(false);
super.onHide(params);
document.body.removeChild(this);
this.parentNode === document.body && document.body.removeChild(this);
}

/**
Expand All @@ -121,6 +121,7 @@ export class ESLTooltip extends ESLPopup {
* Actions to execute before hiding of popup.
*/
protected override beforeOnHide(): void {
super.beforeOnHide();
this.activator?.focus({preventScroll: true});
}

Expand Down

0 comments on commit 9c25137

Please sign in to comment.