-
Couldn't load subscription status.
- Fork 6.8k
feat(a11y): add autoCapture option to cdkTrapFocus #7641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| * initialization and return focus to the previous activeElement upon destruction. | ||
| */ | ||
| @Input('cdkTrapFocusAutoCapture') | ||
| get autoCapture(): boolean { return this._autoCapture; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this won't react to value changes, maybe it should be a plain @Input without the coercion or it should take the value via an @Attribute?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made it an input since people may want to build a higher-level component on top of it and forward from their own API for the equivalent behavior
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, although I do feel like we're starting to add the coercion to everything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to push for Angular to add @BooleanInput (and @NumberInput) to help with this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| * initialization and return focus to the previous activeElement upon destruction. | ||
| */ | ||
| @Input('cdkTrapFocusAutoCapture') | ||
| get autoCapture(): boolean { return this._autoCapture; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, although I do feel like we're starting to add the coercion to everything.
|
Breaking changes message? Or is the plan to wait until the re-export is removed? |
|
It should be a deprecation notice in the next release |
87bd95e to
d38ea13
Compare
This also renames "FocusTrapDirective" to "CdkTrapFocus" and re-exports it under the old name.
d38ea13 to
8a781b5
Compare
|
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 also renames "FocusTrapDirective" to "CdkTrapFocus" and re-exports it under the old name.