Skip to content

Commit

Permalink
fix: fix focus and position calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
ala-n committed Feb 4, 2021
1 parent b0925fa commit 815b8ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modules/draft/esl-select/core/esl-select-dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class ESLSelectDropdown extends ESLBasePopup {
}
protected onHide(params: PopupActionParams) {
const select = this.activator;
select && setTimeout(() => select.focus(), 0);
select && setTimeout(() => select.focus({ preventScroll: true }), 0);
super.onHide(params);
this._disposeTimeout = window.setTimeout(() => {
document.body.removeChild(this);
Expand All @@ -74,7 +74,7 @@ export class ESLSelectDropdown extends ESLBasePopup {
const windowY = window.scrollY || window.pageYOffset;
const rect = this.activator.getBoundingClientRect();

this.style.top = `${windowY + rect.y + rect.height}px`;
this.style.top = `${windowY + rect.top + rect.height}px`;
this.style.left = `${rect.left}px`;
this.style.width = `${rect.width}px`;
}
Expand Down

0 comments on commit 815b8ad

Please sign in to comment.