Skip to content

Commit

Permalink
fix: no scroll update when managing elements outside of the tab order
Browse files Browse the repository at this point in the history
  • Loading branch information
Westbrook committed May 24, 2021
1 parent 1ac1293 commit 144c548
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/shared/src/focusable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export class Focusable extends FocusVisiblePolyfillMixin(SpectrumElement) {
private onPointerdownManagementOfTabIndex(): void {
if (this.tabIndex === -1) {
this.tabIndex = 0;
this.focus();
this.focus({ preventScroll: true });
}
}

Expand All @@ -151,15 +151,15 @@ export class Focusable extends FocusVisiblePolyfillMixin(SpectrumElement) {
throw new Error('Must implement focusElement getter!');
}

public focus(): void {
public focus(options?: FocusOptions): void {
if (this.disabled || !this.focusElement) {
return;
}

if (this.focusElement !== this) {
this.focusElement.focus();
this.focusElement.focus(options);
} else {
HTMLElement.prototype.focus.apply(this);
HTMLElement.prototype.focus.apply(this, [options]);
}
}

Expand Down

0 comments on commit 144c548

Please # to comment.