Skip to content

Commit 9a45de1

Browse files
committed
fix(UISref): don't break middle-click and meta+click
1 parent 82bad02 commit 9a45de1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/components/UISref.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,13 @@ export class UISref extends Component<IProps,any> {
3838
}
3939

4040
handleClick = (e) => {
41-
e.preventDefault();
42-
let params = this.props.params || {};
43-
let to = this.props.to;
44-
let options = this.getOptions();
45-
UIRouterReact.instance.stateService.go(to, params, options);
41+
if (!e.defaultPrevented && !(e.button == 1 || e.metaKey || e.ctrlKey)) {
42+
e.preventDefault();
43+
let params = this.props.params || {};
44+
let to = this.props.to;
45+
let options = this.getOptions();
46+
UIRouterReact.instance.stateService.go(to, params, options);
47+
}
4648
}
4749

4850
render () {

0 commit comments

Comments
 (0)