@@ -549,60 +549,60 @@ describe('Ionic Tap', function() {
549
549
expect ( tapClick ( e ) ) . toEqual ( false ) ;
550
550
} ) ;
551
551
552
- it ( 'Should tapRequiresNativeClick for invalid element' , function ( ) {
553
- expect ( tapRequiresNativeClick ( null ) ) . toEqual ( true ) ;
552
+ it ( 'Should ionic.tap.requiresNativeClick for invalid element' , function ( ) {
553
+ expect ( ionic . tap . requiresNativeClick ( null ) ) . toEqual ( true ) ;
554
554
} ) ;
555
555
556
- it ( 'Should tapRequiresNativeClick for input.disabled' , function ( ) {
556
+ it ( 'Should ionic.tap.requiresNativeClick for input.disabled' , function ( ) {
557
557
var ele = document . createElement ( 'input' ) ;
558
558
ele . disabled = true ;
559
- expect ( tapRequiresNativeClick ( ele ) ) . toEqual ( true ) ;
559
+ expect ( ionic . tap . requiresNativeClick ( ele ) ) . toEqual ( true ) ;
560
560
} ) ;
561
561
562
- it ( 'Should tapRequiresNativeClick for input[range]' , function ( ) {
562
+ it ( 'Should ionic.tap.requiresNativeClick for input[range]' , function ( ) {
563
563
var ele = document . createElement ( 'input' ) ;
564
564
ele . type = 'range' ;
565
- expect ( tapRequiresNativeClick ( ele ) ) . toEqual ( true ) ;
565
+ expect ( ionic . tap . requiresNativeClick ( ele ) ) . toEqual ( true ) ;
566
566
} ) ;
567
567
568
- it ( 'Should tapRequiresNativeClick for input[file]' , function ( ) {
568
+ it ( 'Should ionic.tap.requiresNativeClick for input[file]' , function ( ) {
569
569
var ele = document . createElement ( 'input' ) ;
570
570
ele . type = 'file' ;
571
- expect ( tapRequiresNativeClick ( ele ) ) . toEqual ( true ) ;
571
+ expect ( ionic . tap . requiresNativeClick ( ele ) ) . toEqual ( true ) ;
572
572
} ) ;
573
573
574
- it ( 'Should tapRequiresNativeClick for video element' , function ( ) {
574
+ it ( 'Should ionic.tap.requiresNativeClick for video element' , function ( ) {
575
575
var ele = document . createElement ( 'video' ) ;
576
- expect ( tapRequiresNativeClick ( ele ) ) . toEqual ( true ) ;
576
+ expect ( ionic . tap . requiresNativeClick ( ele ) ) . toEqual ( true ) ;
577
577
} ) ;
578
578
579
- it ( 'Should tapRequiresNativeClick for object element' , function ( ) {
579
+ it ( 'Should ionic.tap.requiresNativeClick for object element' , function ( ) {
580
580
var ele = document . createElement ( 'object' ) ;
581
- expect ( tapRequiresNativeClick ( ele ) ) . toEqual ( true ) ;
581
+ expect ( ionic . tap . requiresNativeClick ( ele ) ) . toEqual ( true ) ;
582
582
} ) ;
583
583
584
- it ( 'Should not tapRequiresNativeClick for common inputs' , function ( ) {
584
+ it ( 'Should not ionic.tap.requiresNativeClick for common inputs' , function ( ) {
585
585
var inputTypes = [ 'text' , 'email' , 'search' , 'tel' , 'number' , 'date' , 'month' , 'password' , null , undefined , '' ] ;
586
586
for ( var x = 0 ; x < inputTypes . length ; x ++ ) {
587
587
var targetEle = document . createElement ( 'input' ) ;
588
588
targetEle . type = inputTypes [ x ] ;
589
- expect ( tapRequiresNativeClick ( targetEle ) ) . toEqual ( false ) ;
589
+ expect ( ionic . tap . requiresNativeClick ( targetEle ) ) . toEqual ( false ) ;
590
590
}
591
- expect ( tapRequiresNativeClick ( document . createElement ( 'img' ) ) ) . toEqual ( false ) ;
592
- expect ( tapRequiresNativeClick ( document . createElement ( 'div' ) ) ) . toEqual ( false ) ;
593
- expect ( tapRequiresNativeClick ( document . createElement ( 'textarea' ) ) ) . toEqual ( false ) ;
594
- expect ( tapRequiresNativeClick ( document . createElement ( 'select' ) ) ) . toEqual ( false ) ;
591
+ expect ( ionic . tap . requiresNativeClick ( document . createElement ( 'img' ) ) ) . toEqual ( false ) ;
592
+ expect ( ionic . tap . requiresNativeClick ( document . createElement ( 'div' ) ) ) . toEqual ( false ) ;
593
+ expect ( ionic . tap . requiresNativeClick ( document . createElement ( 'textarea' ) ) ) . toEqual ( false ) ;
594
+ expect ( ionic . tap . requiresNativeClick ( document . createElement ( 'select' ) ) ) . toEqual ( false ) ;
595
595
} ) ;
596
596
597
- it ( 'Should tapRequiresNativeClick for an element with data-tap-disabled attribute' , function ( ) {
597
+ it ( 'Should ionic.tap.requiresNativeClick for an element with data-tap-disabled attribute' , function ( ) {
598
598
var div = document . createElement ( 'div' ) ;
599
- expect ( tapRequiresNativeClick ( div ) ) . toEqual ( false ) ;
599
+ expect ( ionic . tap . requiresNativeClick ( div ) ) . toEqual ( false ) ;
600
600
601
601
div . setAttribute ( 'data-tap-disabled' , "true" ) ;
602
- expect ( tapRequiresNativeClick ( div ) ) . toEqual ( true ) ;
602
+ expect ( ionic . tap . requiresNativeClick ( div ) ) . toEqual ( true ) ;
603
603
} ) ;
604
604
605
- it ( 'Should tapRequiresNativeClick for an element with one of its parents with data-tap-disabled attribute' , function ( ) {
605
+ it ( 'Should ionic.tap.requiresNativeClick for an element with one of its parents with data-tap-disabled attribute' , function ( ) {
606
606
var div1 = document . createElement ( 'div' ) ;
607
607
var div2 = document . createElement ( 'div' ) ;
608
608
var div3 = document . createElement ( 'div' ) ;
@@ -616,11 +616,11 @@ describe('Ionic Tap', function() {
616
616
617
617
div2 . setAttribute ( 'data-tap-disabled' , "true" ) ;
618
618
619
- expect ( tapRequiresNativeClick ( div1 ) ) . toEqual ( false ) ;
620
- expect ( tapRequiresNativeClick ( div2 ) ) . toEqual ( true ) ;
621
- expect ( tapRequiresNativeClick ( div3 ) ) . toEqual ( true ) ;
622
- expect ( tapRequiresNativeClick ( div4 ) ) . toEqual ( true ) ;
623
- expect ( tapRequiresNativeClick ( div5 ) ) . toEqual ( true ) ;
619
+ expect ( ionic . tap . requiresNativeClick ( div1 ) ) . toEqual ( false ) ;
620
+ expect ( ionic . tap . requiresNativeClick ( div2 ) ) . toEqual ( true ) ;
621
+ expect ( ionic . tap . requiresNativeClick ( div3 ) ) . toEqual ( true ) ;
622
+ expect ( ionic . tap . requiresNativeClick ( div4 ) ) . toEqual ( true ) ;
623
+ expect ( ionic . tap . requiresNativeClick ( div5 ) ) . toEqual ( true ) ;
624
624
} ) ;
625
625
626
626
it ( 'Should not allow a click that has an textarea target but not created by tapClick' , function ( ) {
@@ -861,6 +861,16 @@ describe('Ionic Tap', function() {
861
861
expect ( ionic . tap . ignoreScrollStart ( e ) ) . toEqual ( true ) ;
862
862
} ) ;
863
863
864
+ it ( 'Should prevent scrolling because the target is input[file]' , function ( ) {
865
+ var target = document . createElement ( 'input' ) ;
866
+ target . type = 'file' ;
867
+ var e = {
868
+ target : target ,
869
+ defaultPrevented : true
870
+ } ;
871
+ expect ( ionic . tap . ignoreScrollStart ( e ) ) . toEqual ( true ) ;
872
+ } ) ;
873
+
864
874
it ( 'Should prevent scrolling because the target is input[range]' , function ( ) {
865
875
var target = document . createElement ( 'input' ) ;
866
876
target . type = 'range' ;
0 commit comments