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 {
8080 removeKeyboardFocus ( ) {
8181 this . isKeyboardFocused = false ;
8282 }
83+
84+ /** TODO(hansl): e2e test this function. */
85+ focus ( ) {
86+ this . elementRef . nativeElement . focus ( ) ;
87+ }
8388}
8489
8590@Component ( {
Original file line number Diff line number Diff line change 6363 < div >
6464 < p > isDisabled: {{isDisabled}}, clickCounter: < span id ="clickCounter "> {{clickCounter}}</ span > </ p >
6565 < 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 >
6669 </ 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 >
6871 < 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 >
7174 < button md-mini-fab [disabled] ="isDisabled ">
7275 < md-icon class ="md-24 "> check</ md-icon >
7376 </ button >
You can’t perform that action at this time.
0 commit comments