fix(tabs): revert isTab check so it is possible to create your own tab

PiperOrigin-RevId: 568670280
This commit is contained in:
Andrew Jakubowicz 2023-09-26 15:47:28 -07:00 committed by Copybara-Service
parent 036ea7b04c
commit e10186e91b
2 changed files with 9 additions and 1 deletions

View File

@ -35,6 +35,13 @@ export class Tab extends LitElement {
setupHostAria(Tab);
}
/**
* Indicates that the element is a tab for `<md-tabs>`. Useful when
* clients implement their own custom `md-tab` components.
* @nocollapse
*/
static readonly isTab = true;
/**
* Whether or not the tab is selected.
**/

View File

@ -307,5 +307,6 @@ export class Tabs extends LitElement {
}
function isTab(element: unknown): element is Tab {
return element instanceof Tab;
if (!element) return false;
return 'isTab' in element.constructor && element.constructor.isTab === true;
}