]> source.dussan.org Git - jquery.git/commitdiff
Event: Don't test stopImmediatePropagation in Android 2.3
authorMichał Gołębiowski <m.goleb@gmail.com>
Tue, 18 Mar 2014 20:00:42 +0000 (21:00 +0100)
committerMichał Gołębiowski <m.goleb@gmail.com>
Tue, 18 Mar 2014 20:00:42 +0000 (21:00 +0100)
Android 2.3 doesn't support stopImmediatePropagation; jQuery fallbacks
to stopPropagation in such a case.

test/unit/event.js

index 4dc6ab83bb8674bb2ac18da14ccc2b2e99bceab1..8bb168a40d79f2e72879a9ce05a2d9b13cb10e13 100644 (file)
@@ -431,8 +431,11 @@ test("on bubbling, isDefaultPrevented, stopImmediatePropagation", function() {
        $anchor2.off( "click" );
        $main.off( "click", "**" );
 
-       if ( !window.addEventListener ) {
-               ok( true, "Old IE, skipping native stopImmediatePropagation check" );
+       // Android 2.3 doesn't support stopImmediatePropagation; jQuery fallbacks to stopPropagation
+       // in such a case.
+       // Support: Android 2.3
+       if ( !window.addEventListener || /android 2\.3/i.test( navigator.userAgent ) ) {
+               ok( true, "Old IE or Android 2.3, skipping native stopImmediatePropagation check" );
        } else {
                $anchor2.on( "click", function( e ) {
                        e.stopImmediatePropagation();