diff --git a/labs/behaviors/focusable.ts b/labs/behaviors/focusable.ts index 98466d36b2..48ff2049c1 100644 --- a/labs/behaviors/focusable.ts +++ b/labs/behaviors/focusable.ts @@ -30,7 +30,6 @@ const privateIsFocusable = Symbol('privateIsFocusable'); const externalTabIndex = Symbol('externalTabIndex'); const isUpdatingTabIndex = Symbol('isUpdatingTabIndex'); const updateTabIndex = Symbol('updateTabIndex'); -const hasConstructed = Symbol('hasConstructed'); /** * Mixes in focusable functionality for a class. @@ -68,10 +67,9 @@ export function mixinFocusable>( this[updateTabIndex](); } - [privateIsFocusable] = false; + [privateIsFocusable] = true; [externalTabIndex]: number | null = null; [isUpdatingTabIndex] = false; - [hasConstructed] = false; // tslint:disable-next-line:no-any constructor(...args: any[]) { @@ -79,9 +77,8 @@ export function mixinFocusable>( this[isFocusable] = true; } - connectedCallback() { + override connectedCallback() { super.connectedCallback(); - this[hasConstructed] = true; this[updateTabIndex](); } @@ -112,11 +109,6 @@ export function mixinFocusable>( } [updateTabIndex]() { - if (!this[hasConstructed]) { - // Custom elements may not hydrate attributes during construction. - return; - } - const internalTabIndex = this[isFocusable] ? 0 : -1; const computedTabIndex = this[externalTabIndex] ?? internalTabIndex;