fix(focus-trap): wrong element being checked when logging deprecation warning - #10578
Merged
josephperrott merged 1 commit intoMar 29, 2018
Merged
Conversation
donroyco
reviewed
Mar 27, 2018
| if (redirectToElement.hasAttribute(`cdk-focus-initial`)) { | ||
| console.warn(`Found use of deprecated attribute 'cdk-focus-initial', ` + | ||
| `use 'cdkFocusInitial' instead. The deprecated attribute ` + | ||
| `will be removed 7.0.0`, redirectToElement); |
josephperrott
requested changes
Mar 27, 2018
| console.warn(`Found use of deprecated attribute 'cdk-focus-initial',` + | ||
| ` use 'cdkFocusInitial' instead.`, this._element); | ||
| // @deletion-target 7.0.0 | ||
| if (redirectToElement.hasAttribute(`cdk-focus-initial`)) { |
Member
There was a problem hiding this comment.
We are not checking to confirm that redirectToElement is not null here. We are seeing some failing tests, where the querySelector does not find anything which results in TypeError: Cannot read property 'hasAttribute' of null
… warning Fixes the host element being checked when logging out the deprecation warning, rather than the deprecated element itself. Also adds deletion targets so we don't miss to deprecate the selectors in 7.0.0. Fixes angular#10566.
crisbeto
force-pushed
the
10566/focus-trap-wrong-long
branch
from
March 28, 2018 19:18
81a32a4 to
0b931ea
Compare
Member
Author
|
Fixed @josephperrott. |
josephperrott
approved these changes
Mar 29, 2018
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the host element being checked when logging out the deprecation warning, rather than the deprecated element itself. Also adds deletion targets so we don't miss to deprecate the selectors in 7.0.0.
Fixes #10566.