File tree Expand file tree Collapse file tree 8 files changed +55
-10
lines changed Expand file tree Collapse file tree 8 files changed +55
-10
lines changed Original file line number Diff line number Diff line change @@ -789,7 +789,8 @@ var __meta__ = { // jshint ignore:line
789789 TreeView : "ul" ,
790790 Menu : "ul" ,
791791 ContextMenu : "ul" ,
792- ActionSheet : "ul"
792+ ActionSheet : "ul" ,
793+ Switch : "input"
793794 } ;
794795
795796 var SKIP_SHORTCUTS = [
Original file line number Diff line number Diff line change @@ -780,7 +780,7 @@ var __meta__ = { // jshint ignore:line
780780 that . _placeholder ( true ) ;
781781 }
782782
783- that . _old = that . _accessor ( ) ;
783+ that . _old = that . _valueBeforeCascade = that . _accessor ( ) ;
784784 that . _oldIndex = that . selectedIndex ;
785785
786786 that . _prev = that . input . val ( ) ;
Original file line number Diff line number Diff line change @@ -424,7 +424,7 @@ var __meta__ = { // jshint ignore:line
424424 }
425425
426426 listView . value ( value ) . done ( function ( ) {
427- that . _old = that . _accessor ( ) ;
427+ that . _old = that . _valueBeforeCascade = that . _accessor ( ) ;
428428 that . _oldIndex = that . selectedIndex ;
429429 } ) ;
430430 } ,
Original file line number Diff line number Diff line change @@ -1795,8 +1795,8 @@ var __meta__ = { // jshint ignore:line
17951795 endY = tapPosition ( e ) ;
17961796
17971797 if ( Math . abs ( endY - startY ) < 10 ) {
1798- e . preventDefault ( ) ;
1799- that . trigger ( "click" , { item : $ ( e . target . closest ( ITEMSELECTOR ) ) } ) ;
1798+ that . _touchTriggered = true ;
1799+ that . _triggerClick ( $ ( e . target ) . closest ( ITEMSELECTOR ) . get ( 0 ) ) ;
18001800 }
18011801 } ) ;
18021802 } ,
@@ -2075,10 +2075,20 @@ var __meta__ = { // jshint ignore:line
20752075 } ,
20762076
20772077 _click : function ( e ) {
2078+ if ( this . _touchTriggered )
2079+ {
2080+ this . _touchTriggered = false ;
2081+ return ;
2082+ }
2083+
20782084 if ( ! e . isDefaultPrevented ( ) ) {
2079- if ( ! this . trigger ( "click" , { item : $ ( e . currentTarget ) } ) ) {
2080- this . select ( e . currentTarget ) ;
2081- }
2085+ this . _triggerClick ( e . currentTarget ) ;
2086+ }
2087+ } ,
2088+
2089+ _triggerClick : function ( item ) {
2090+ if ( ! this . trigger ( "click" , { item : $ ( item ) } ) ) {
2091+ this . select ( item ) ;
20822092 }
20832093 } ,
20842094
Original file line number Diff line number Diff line change @@ -604,7 +604,7 @@ var __meta__ = { // jshint ignore:line
604604 }
605605
606606 listView . value ( value ) ;
607- that . _old = listView . value ( ) ; //get a new array reference
607+ that . _old = that . _valueBeforeCascade = listView . value ( ) ; //get a new array reference
608608
609609 if ( ! clearFilters ) {
610610 that . _fetchData ( ) ;
Original file line number Diff line number Diff line change 108108 assert . equal ( combobox . _old , "2" ) ;
109109 } ) ;
110110
111+ it ( "change is not triggered on blur after value()" , function ( ) {
112+ var combobox = new ComboBox ( input , {
113+ change : function ( ) {
114+ assert . isOk ( false ) ;
115+ }
116+ } ) ;
117+ combobox . value ( "2" ) ;
118+
119+ combobox . _blur ( ) ;
120+ } ) ;
121+
111122 it ( "value('') clear selection" , function ( ) {
112123 var combobox = new ComboBox ( input , {
113124 dataTextField : "text" ,
Original file line number Diff line number Diff line change 4242 assert . equal ( dropdownlist . text ( ) , 2 ) ;
4343 } ) ;
4444
45+ it ( "change is not triggered on blur after value()" , function ( ) {
46+ dropdownlist = createDropDownList ( {
47+ change : function ( ) {
48+ assert . isOk ( false ) ;
49+ }
50+ } ) ;
51+ dropdownlist . value ( "2" ) ;
52+
53+ dropdownlist . _blur ( ) ;
54+ } ) ;
55+
4556 it ( "value method should select optionLabel if it does not exist" , function ( ) {
4657 dropdownlist = new DropDownList ( input , {
4758 optionLabel : "select" ,
10191030 done ( ) ;
10201031 }
10211032 } ) ;
1022-
1033+
10231034 dropdownlist . value ( "item2" ) ;
10241035 } ) ;
10251036
Original file line number Diff line number Diff line change 296296 } ) ;
297297 } ) ;
298298
299+ it ( "change is not triggered on blur after value()" , function ( ) {
300+ popuplateSelect ( ) ;
301+ var multiselect = new MultiSelect ( select , {
302+ change : function ( ) {
303+ assert . isOk ( false ) ;
304+ }
305+ } ) ;
306+
307+ multiselect . value ( [ "0" , "1" ] ) ;
308+ multiselect . _blur ( ) ;
309+ } ) ;
310+
299311 it ( "MultiSelect opens popup" , function ( ) {
300312 popuplateSelect ( ) ;
301313 var multiselect = new MultiSelect ( select ) ;
You can’t perform that action at this time.
0 commit comments