Skip to content
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

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

Merged
merged 7 commits into from
Oct 27, 2017

Conversation

amcdnl
Copy link
Contributor

@amcdnl amcdnl commented Sep 9, 2017

Addresses #6799

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Sep 9, 2017
@@ -144,19 +144,24 @@ export class FocusTrap {
* @param bound The boundary to get (start or end of trapped region).
* @returns The boundary element.
*/
private _getRegionBoundary(bound: 'start' | 'end'): HTMLElement | null {
private _getRegionBoundary(bound: 'Start' | 'End'): HTMLElement | null {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we change this back to 'start' and 'end'? I'm pretty sure everywhere else we use string literal types we use all lowercase, we can just convert to upper case in the method

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done :)

@@ -68,10 +68,10 @@
<md-sidenav #focusSidenav>
<md-nav-list>
<a md-list-item routerLink>Link</a>
<a md-list-item routerLink cdk-focus-region-start>Focus region start</a>
<a md-list-item routerLink cdkFocusStart>Focus region start</a>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cdkFocusRegionStart

<a md-list-item routerLink cdk-focus-initial>Initially focused</a>
<a md-list-item routerLink cdk-focus-region-end>Focus region end</a>
<a md-list-item routerLink cdkFocusInitial>Initially focused</a>
<a md-list-item routerLink cdkFocusEnd>Focus region end</a>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cdkFocusRegionEnd

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • face palm * ---> fixed.

@mmalerba mmalerba added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Sep 12, 2017
@jelbourn jelbourn added the P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful label Sep 22, 2017
@mmalerba mmalerba added pr: needs rebase and removed action: merge The PR is ready for merge by the caretaker labels Sep 22, 2017
@mmalerba
Copy link
Contributor

please rebase

…cus-trap-6799

# Conflicts:
#	src/demo-app/sidenav/sidenav-demo.html
@amcdnl
Copy link
Contributor Author

amcdnl commented Sep 24, 2017

@mmalerba - done. Noticed that the focus trap is removed from the demo now, is that by design?

@mmalerba
Copy link
Contributor

@mmalerba
Copy link
Contributor

@amcdnl rebase?

@amcdnl
Copy link
Contributor Author

amcdnl commented Oct 19, 2017

@mmalerba - done :)

@mmalerba mmalerba added action: merge The PR is ready for merge by the caretaker and removed action: merge The PR is ready for merge by the caretaker labels Oct 19, 2017
@mmalerba
Copy link
Contributor

And the sidenav demo got moved to the drawer demo, so that needs update as well

@amcdnl
Copy link
Contributor Author

amcdnl commented Oct 20, 2017

@mmalerba - done

@mmalerba mmalerba added the action: merge The PR is ready for merge by the caretaker label Oct 20, 2017
// Contains the deprecated version of selector, for temporary backwards comparability.
let markers = this._element.querySelectorAll(`[cdk-focus-region-${bound}], ` +
`[cdk-focus-${bound}]`) as NodeListOf<HTMLElement>;
`[cdkFocusRegion${bound}], ` +
`[cdk-focus-${name}]`) as NodeListOf<HTMLElement>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name should be bound


for (let i = 0; i < markers.length; i++) {
if (markers[i].hasAttribute(`cdk-focus-${bound}`)) {
console.warn(`Found use of deprecated attribute 'cdk-focus-${bound}',` +
` use 'cdk-focus-region-${bound}' instead.`, markers[i]);
` use 'cdkFocusRegion${name}' instead.`, markers[i]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name should be bound

` use 'cdkFocusRegion${name}' instead.`, markers[i]);
} else if (markers[i].hasAttribute(`cdk-focus-region-${bound}`)) {
console.warn(`Found use of deprecated attribute 'cdk-focus-region-${bound}',` +
` use 'cdkFocusRegion${name}' instead.`, markers[i]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name should be bound

@amcdnl
Copy link
Contributor Author

amcdnl commented Oct 24, 2017

Done :)

@mmalerba mmalerba merged commit c663fad into angular:master Oct 27, 2017
@amcdnl amcdnl deleted the focus-trap-6799 branch October 30, 2017 14:18
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants