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(dialog): change order of button actions #9021

Merged
merged 3 commits into from
Dec 20, 2017
Merged

fix(dialog): change order of button actions #9021

merged 3 commits into from
Dec 20, 2017

Conversation

donroyco
Copy link
Contributor

Change order of buttons for affirmative actions, according to Material guidelines. This fixes #9019

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Dec 16, 2017
<button mat-button (click)="onNoClick()" tabindex="-1">No Thanks</button>
<button mat-button [mat-dialog-close]="data.animal" tabindex="2">Ok</button>
Copy link
Member

Choose a reason for hiding this comment

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

Not something that you added, but while we're at it, can you remove the tabindex from the buttons here and in the other example and replace the positive tabindex with an cdk-focus-initial attribute?

Copy link
Contributor Author

@donroyco donroyco Dec 16, 2017

Choose a reason for hiding this comment

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

Will do @crisbeto, is there an attribute order? <button mat-button cdk-focus-initial [mat-dialog-close]="true"> or <button mat-button [mat-dialog-close]="true" cdk-focus-initial>?

Copy link
Member

Choose a reason for hiding this comment

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

We don't have any rules for the attribute order.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok!

<button mat-raised-button mat-dialog-close>Close</button>
<button mat-raised-button color="primary" mat-dialog-close>Submit</button>
Copy link
Member

@crisbeto crisbeto Dec 16, 2017

Choose a reason for hiding this comment

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

Can you add the attribute to this one as well? Also sorry, but I just remembered that we deprecated cdk-focus-initial. cdkFocusInitial is the proper one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No problem at all

Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

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

LGTM

@crisbeto crisbeto added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Dec 16, 2017
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

@josephperrott josephperrott merged commit 230b297 into angular:master Dec 20, 2017
@donroyco donroyco deleted the bugfix/align-button-order-dialog branch December 20, 2017 06:37
josephperrott pushed a commit to josephperrott/components that referenced this pull request Jan 2, 2018
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Confirmative dialog buttons should be placed on the right side
5 participants