File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,11 @@ export class MdButton {
80
80
removeKeyboardFocus ( ) {
81
81
this . isKeyboardFocused = false ;
82
82
}
83
+
84
+ /** TODO(hansl): e2e test this function. */
85
+ focus ( ) {
86
+ this . elementRef . nativeElement . focus ( ) ;
87
+ }
83
88
}
84
89
85
90
@Component ( {
Original file line number Diff line number Diff line change 63
63
< div >
64
64
< p > isDisabled: {{isDisabled}}, clickCounter: < span id ="clickCounter "> {{clickCounter}}</ span > </ p >
65
65
< button md-raised-button (click) ="isDisabled=!isDisabled " id ="disableToggle "> Disable buttons</ button >
66
+ < button md-raised-button (click) ="button1.focus() " id ="disableToggle "> Focus 1</ button >
67
+ < button md-raised-button (click) ="button2.focus() " id ="disableToggle "> Focus 2</ button >
68
+ < button md-raised-button (click) ="button3.focus() " id ="disableToggle "> Focus 3</ button >
66
69
</ div >
67
- < button md-button [disabled] ="isDisabled " (click) ="clickCounter=clickCounter+1 " id ="testButton "> off</ button >
70
+ < button md-button #button1 [disabled] ="isDisabled " (click) ="clickCounter=clickCounter+1 " id ="testButton "> off</ button >
68
71
< button md-button color ="primary " [disabled] ="isDisabled "> off</ button >
69
- < a href ="http://www.google.com " md-button color ="accent " [disabled] ="isDisabled "> off</ a >
70
- < button md-raised-button color ="primary " [disabled] ="isDisabled "> off</ button >
72
+ < a href ="http://www.google.com " #button2 md-button color ="accent " [disabled] ="isDisabled "> off</ a >
73
+ < button md-raised-button #button3 color ="primary " [disabled] ="isDisabled "> off</ button >
71
74
< button md-mini-fab [disabled] ="isDisabled ">
72
75
< md-icon class ="md-24 "> check</ md-icon >
73
76
</ button >
You can’t perform that action at this time.
0 commit comments