Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit c6dd725

Browse files
author
Gabriel Schulhof
committed
Navigation: If the default is prevented on the originalEvent of "navigate", do not go into _handleHashChange. Fixes #5775.
1 parent 320fbba commit c6dd725

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

js/jquery.mobile.navigation.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1345,7 +1345,13 @@ define( [
13451345

13461346
// TODO roll the logic here into the handleHashChange method
13471347
$window.bind( "navigate", function( e, data ) {
1348-
var url = $.event.special.navigate.originalEventName.indexOf( "hashchange" ) > -1 ? data.state.hash : data.state.url;
1348+
var url;
1349+
1350+
if ( e.originalEvent && e.originalEvent.isDefaultPrevented() ) {
1351+
return;
1352+
}
1353+
1354+
url = $.event.special.navigate.originalEventName.indexOf( "hashchange" ) > -1 ? data.state.hash : data.state.url;
13491355

13501356
if( !url ) {
13511357
url = $.mobile.path.parseLocation().hash;

0 commit comments

Comments
 (0)