This repository was archived by the owner on Sep 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -151,6 +151,7 @@ function MenuDirective($mdMenu) {
151
151
triggerElement = triggerElement . querySelector ( '[ng-click]' ) ;
152
152
}
153
153
triggerElement && triggerElement . setAttribute ( 'aria-haspopup' , 'true' ) ;
154
+ triggerElement . setAttribute ( 'type' , 'button' ) ;
154
155
if ( templateElement . children ( ) . length != 2 ) {
155
156
throw Error ( 'Invalid HTML for md-menu. Expected two children elements.' ) ;
156
157
}
Original file line number Diff line number Diff line change @@ -23,12 +23,18 @@ describe('md-menu directive', function () {
23
23
expect ( buildBadMenu ) . toThrow ( ) ;
24
24
} ) ) ;
25
25
26
+
26
27
it ( 'removes everything but the first element' , function ( ) {
27
28
var menu = setup ( ) [ 0 ] ;
28
29
expect ( menu . children . length ) . toBe ( 1 ) ;
29
30
expect ( menu . firstElementChild . nodeName ) . toBe ( 'BUTTON' ) ;
30
31
} ) ;
31
32
33
+ iit ( 'specifies button type' , inject ( function ( $compile , $rootScope ) {
34
+ var menu = setup ( ) [ 0 ] ;
35
+ expect ( menu . firstElementChild . getAttribute ( 'type' ) ) . toBe ( 'button' ) ;
36
+ } ) ) ;
37
+
32
38
it ( 'opens on click' , function ( ) {
33
39
var menu = setup ( ) ;
34
40
openMenu ( menu ) ;
You can’t perform that action at this time.
0 commit comments