File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,18 @@ describe('details-menu element', function() {
121
121
assert ( ! details . open , 'details toggles closed' )
122
122
} )
123
123
124
+ it ( 'allow propagation on escape if details is closed' , function ( ) {
125
+ const details = document . querySelector ( 'details' )
126
+ const summary = details . querySelector ( 'summary' )
127
+
128
+ document . addEventListener ( 'keydown' , event => {
129
+ if ( event . key === 'Escape' ) summary . textContent = 'Propagated'
130
+ } )
131
+
132
+ summary . dispatchEvent ( new KeyboardEvent ( 'keydown' , { key : 'Escape' , bubbles : true } ) )
133
+ assert . equal ( summary . textContent , 'Propagated' )
134
+ } )
135
+
124
136
it ( 'updates the button label with text' , function ( ) {
125
137
const details = document . querySelector ( 'details' )
126
138
const summary = details . querySelector ( 'summary' )
You can’t perform that action at this time.
0 commit comments