@@ -146,12 +146,15 @@ export class FocusTrap {
146
146
`[cdk-focus-${ bound } ]` ) as NodeListOf < HTMLElement > ;
147
147
148
148
for ( let i = 0 ; i < markers . length ; i ++ ) {
149
+ // @deletion -target 7.0.0
149
150
if ( markers [ i ] . hasAttribute ( `cdk-focus-${ bound } ` ) ) {
150
- console . warn ( `Found use of deprecated attribute 'cdk-focus-${ bound } ',` +
151
- ` use 'cdkFocusRegion${ bound } ' instead.` , markers [ i ] ) ;
151
+ console . warn ( `Found use of deprecated attribute 'cdk-focus-${ bound } ', ` +
152
+ `use 'cdkFocusRegion${ bound } ' instead. The deprecated ` +
153
+ `attribute will be removed in 7.0.0.` , markers [ i ] ) ;
152
154
} else if ( markers [ i ] . hasAttribute ( `cdk-focus-region-${ bound } ` ) ) {
153
- console . warn ( `Found use of deprecated attribute 'cdk-focus-region-${ bound } ',` +
154
- ` use 'cdkFocusRegion${ bound } ' instead.` , markers [ i ] ) ;
155
+ console . warn ( `Found use of deprecated attribute 'cdk-focus-region-${ bound } ', ` +
156
+ `use 'cdkFocusRegion${ bound } ' instead. The deprecated attribute ` +
157
+ `will be removed in 7.0.0.` , markers [ i ] ) ;
155
158
}
156
159
}
157
160
@@ -171,12 +174,14 @@ export class FocusTrap {
171
174
const redirectToElement = this . _element . querySelector ( `[cdk-focus-initial], ` +
172
175
`[cdkFocusInitial]` ) as HTMLElement ;
173
176
174
- if ( this . _element . hasAttribute ( `cdk-focus-initial` ) ) {
175
- console . warn ( `Found use of deprecated attribute 'cdk-focus-initial',` +
176
- ` use 'cdkFocusInitial' instead.` , this . _element ) ;
177
- }
178
-
179
177
if ( redirectToElement ) {
178
+ // @deletion -target 7.0.0
179
+ if ( redirectToElement . hasAttribute ( `cdk-focus-initial` ) ) {
180
+ console . warn ( `Found use of deprecated attribute 'cdk-focus-initial', ` +
181
+ `use 'cdkFocusInitial' instead. The deprecated attribute ` +
182
+ `will be removed in 7.0.0` , redirectToElement ) ;
183
+ }
184
+
180
185
redirectToElement . focus ( ) ;
181
186
return true ;
182
187
}
0 commit comments