File tree 4 files changed +17
-8
lines changed
4 files changed +17
-8
lines changed Original file line number Diff line number Diff line change 237
237
238
238
it ( 'should fire on clear' , function ( ) {
239
239
combobox . value = 'foo' ;
240
- combobox . $ . clearIcon . click ( ) ;
240
+ fire ( 'up' , combobox . $ . clearIcon ) ;
241
241
242
242
expect ( changeSpy . callCount ) . to . equal ( 1 ) ;
243
243
} ) ;
315
315
it ( 'should clear the selection when tapping on the icon' , function ( ) {
316
316
combobox . open ( ) ;
317
317
318
- fire ( 'tap ' , clearIcon ) ;
318
+ fire ( 'up ' , clearIcon ) ;
319
319
320
320
expect ( combobox . value ) . to . eql ( '' ) ;
321
321
expect ( combobox . $ . overlay . _selectedItem ) . to . be . null ;
325
325
it ( 'should close the dropdown after clearing a selection' , function ( ) {
326
326
combobox . open ( ) ;
327
327
328
- fire ( 'tap ' , clearIcon ) ;
328
+ fire ( 'up ' , clearIcon ) ;
329
329
330
330
expect ( combobox . opened ) . to . eql ( false ) ;
331
331
} ) ;
Original file line number Diff line number Diff line change 39
39
}
40
40
41
41
function tapInput ( ) {
42
- fire ( 'tap' , combobox . inputElement ) ;
42
+ // This listener should listen for "tap" again once composedPath() issues with touch devices
43
+ // have been fixed. See https://github.com/Polymer/polymer/issues/4670
44
+ fire ( 'up' , combobox . inputElement ) ;
43
45
}
44
46
45
47
function tapToggleIcon ( ) {
46
- fire ( 'tap' , combobox . $$ ( 'paper-input-container #toggleIcon' ) ) ;
48
+ // This listener should listen for "tap" again once composedPath() issues with touch devices
49
+ // have been fixed. See https://github.com/Polymer/polymer/issues/4670
50
+ fire ( 'up' , combobox . $$ ( 'paper-input-container #toggleIcon' ) ) ;
47
51
}
48
52
49
53
function overlay ( ) {
Original file line number Diff line number Diff line change 84
84
} ) ;
85
85
86
86
it ( 'should toggle overlay by tapping toggle element' , function ( ) {
87
- comboBox . _toggleElement . dispatchEvent ( new CustomEvent ( 'tap ' , { bubbles : true } ) ) ;
87
+ comboBox . _toggleElement . dispatchEvent ( new CustomEvent ( 'up ' , { bubbles : true } ) ) ;
88
88
expect ( comboBox . opened ) . to . be . true ;
89
89
90
- comboBox . _toggleElement . dispatchEvent ( new CustomEvent ( 'tap ' , { bubbles : true } ) ) ;
90
+ comboBox . _toggleElement . dispatchEvent ( new CustomEvent ( 'up ' , { bubbles : true } ) ) ;
91
91
expect ( comboBox . opened ) . to . be . false ;
92
92
} ) ;
93
93
Original file line number Diff line number Diff line change 198
198
this . addEventListener ( 'vaadin-dropdown-closed' , this . _onClosed . bind ( this ) ) ;
199
199
this . addEventListener ( 'vaadin-dropdown-opened' , this . _onOpened . bind ( this ) ) ;
200
200
this . addEventListener ( 'keydown' , this . _onKeyDown . bind ( this ) ) ;
201
- this . _addEventListenerToNode ( this , 'tap' , this . _onTap . bind ( this ) ) ;
201
+
202
+ // This listener should listen for "tap" again once composedPath() issues with touch devices
203
+ // have been fixed. See https://github.com/Polymer/polymer/issues/4670
204
+ this . _addEventListenerToNode ( this , 'up' , this . _onTap . bind ( this ) ) ;
202
205
}
203
206
204
207
_onBlur ( ) {
218
221
}
219
222
220
223
_onTap ( e ) {
224
+ // prevent 'tap' from getting generated and closing the overlay etc.
225
+ Polymer . Gestures . prevent ( 'tap' ) ;
221
226
this . _closeOnBlurIsPrevented = true ;
222
227
223
228
var path = e . composedPath ( ) ;
You can’t perform that action at this time.
0 commit comments