@@ -30,7 +30,6 @@ const privateIsFocusable = Symbol('privateIsFocusable');
30
30
const externalTabIndex = Symbol ( 'externalTabIndex' ) ;
31
31
const isUpdatingTabIndex = Symbol ( 'isUpdatingTabIndex' ) ;
32
32
const updateTabIndex = Symbol ( 'updateTabIndex' ) ;
33
- const hasConstructed = Symbol ( 'hasConstructed' ) ;
34
33
35
34
/**
36
35
* Mixes in focusable functionality for a class.
@@ -68,20 +67,18 @@ export function mixinFocusable<T extends MixinBase<LitElement>>(
68
67
this [ updateTabIndex ] ( ) ;
69
68
}
70
69
71
- [ privateIsFocusable ] = false ;
70
+ [ privateIsFocusable ] = true ;
72
71
[ externalTabIndex ] : number | null = null ;
73
72
[ isUpdatingTabIndex ] = false ;
74
- [ hasConstructed ] = false ;
75
73
76
74
// tslint:disable-next-line:no-any
77
75
constructor ( ...args : any [ ] ) {
78
76
super ( ...args ) ;
79
77
this [ isFocusable ] = true ;
80
78
}
81
79
82
- connectedCallback ( ) {
80
+ override connectedCallback ( ) {
83
81
super . connectedCallback ( ) ;
84
- this [ hasConstructed ] = true ;
85
82
this [ updateTabIndex ] ( ) ;
86
83
}
87
84
@@ -112,11 +109,6 @@ export function mixinFocusable<T extends MixinBase<LitElement>>(
112
109
}
113
110
114
111
[ updateTabIndex ] ( ) {
115
- if ( ! this [ hasConstructed ] ) {
116
- // Custom elements may not hydrate attributes during construction.
117
- return ;
118
- }
119
-
120
112
const internalTabIndex = this [ isFocusable ] ? 0 : - 1 ;
121
113
const computedTabIndex = this [ externalTabIndex ] ?? internalTabIndex ;
122
114
0 commit comments