Skip to content

No deprecation warning for cdk-focus-initial on console or change log #10566

@emilio-martinez

Description

@emilio-martinez

Bug, feature request, or proposal:

Bug

What is the expected behavior?

Use of 'cdk-focus-initial' will result in printing the following warning

Found use of deprecated attribute 'cdk-focus-initial', use 'cdkFocusInitial' instead.

What is the current behavior?

No message is printed because this._element is checked for a cdk-focus-initial attribute rather than redirectToElement. See reference to relevant lines below—shown is v5.2.4, but the same applies to master.

https://github.com/angular/material2/blob/5.2.4/src/cdk/a11y/focus-trap/focus-trap.ts#L169-L185

What are the steps to reproduce?

The below repro is basically the same as the example on the Angular Material website, but cdk-focus-initial instead of cdkFocusInitial.

https://stackblitz.com/edit/angular-material2-deprecated-cdk-focus-initial

screenshot 2018-03-25 14 30 19

What is the use-case or motivation for changing an existing behavior?

Correctly showing deprecation warning.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Versions of @angular/cdk since c663fad was introduced in 5.0.0-rc0.

Is there anything else we should know?

The changelog for 5.0.0-rc0 only noted the attribute change to camel case (quote shown below) but did not note it as a deprecation, which is problematic because users haven't been getting this warning at all so far as shown above.

focus-trap: update focus trap attrs to camel case #6799 (#6960) (c663fad)

Metadata

Metadata

Assignees

Labels

P4A relatively minor issue that is not relevant to core functions

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions