File tree Expand file tree Collapse file tree 2 files changed +17
-7
lines changed Expand file tree Collapse file tree 2 files changed +17
-7
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " redux-unity-router" ,
3- "version" : " 1.6.0 " ,
3+ "version" : " 1.6.1 " ,
44 "description" : " Redux router that syncs history with store" ,
55 "main" : " dist/index.js" ,
66 "scripts" : {
Original file line number Diff line number Diff line change @@ -63,29 +63,39 @@ class Link extends BaseRouterComponent {
6363 initiateLocationChange ( e ) {
6464 const { target } = this . props ;
6565
66- if ( ! target && ! this . href . protocol && ( e . nativeEvent && e . nativeEvent . which ) !== 2 && ! e . metaKey && ! e . ctrlKey ) {
66+ if ( ! target &&
67+ ! e . altKey &&
68+ ! e . metaKey &&
69+ ! e . ctrlKey &&
70+ ! this . href . protocol &&
71+ ( e . nativeEvent && e . nativeEvent . which ) !== 2
72+ ) {
6773 e . preventDefault ( ) ;
6874 this . locationChange ( this . href ) ;
6975 }
7076 }
7177
7278 handleClick ( e ) {
73-
7479 const { onClick } = this . props ;
7580
7681 if ( typeof onClick === 'function' ) {
77-
7882 const onClickResult = onClick ( e ) ;
7983
80- if ( typeof onClickResult === 'object' && typeof onClickResult . then === 'function' ) {
84+ if ( typeof onClickResult === 'object' &&
85+ typeof onClickResult . then === 'function' ) {
8186 e . persist ( ) ;
87+
8288 return onClickResult . then ( ( ) => {
83- this . initiateLocationChange ( e ) ;
89+ if ( ! e . defaultPrevented ) {
90+ this . initiateLocationChange ( e ) ;
91+ }
8492 } ) ;
8593 }
8694 }
8795
88- return this . initiateLocationChange ( e ) ;
96+ if ( ! e . defaultPrevented ) {
97+ return this . initiateLocationChange ( e ) ;
98+ }
8999 }
90100
91101 getHref ( props ) {
You can’t perform that action at this time.
0 commit comments