Skip to content

Commit

Permalink
fix(tabs): use instanceof to check for a Tab
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 562917297
  • Loading branch information
AndrewJakubowicz authored and Copybara-Service committed Sep 5, 2023
1 parent 29f1318 commit 58497f1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 0 additions & 6 deletions tabs/internal/tab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ export class Tab extends LitElement {
static override shadowRootOptions:
ShadowRootInit = {mode: 'open', delegatesFocus: true};

/**
* @private indicates that the element is a tab for `<md-tabs>`
* @nocollapse
*/
static readonly isTab = true;

/**
* Whether or not the tab is `selected`.
**/
Expand Down
2 changes: 1 addition & 1 deletion tabs/internal/tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,5 +296,5 @@ export class Tabs extends LitElement {
}

function isTab(element: HTMLElement): element is Tab {
return 'isTab' in element.constructor && element.constructor.isTab === true;
return element instanceof Tab;
}

0 comments on commit 58497f1

Please sign in to comment.