File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
packages/module/src/components/CatalogTile Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -63,14 +63,24 @@ export class CatalogTile extends React.Component<CatalogTileProps> {
6363 private handleClick = ( e : React . FormEvent < HTMLInputElement > | React . MouseEvent < Element , MouseEvent > ) => {
6464 const { onClick, href } = this . props ;
6565
66- if ( ! href ) {
67- e . preventDefault ( ) ;
68- } else {
66+ if ( "type" in e && e . type === "click" && onClick ) {
67+ // It's a MouseEvent
68+ const mouseEvent = e as React . MouseEvent < Element , MouseEvent > ;
69+ if (
70+ mouseEvent . metaKey || // Cmd key (Mac)
71+ mouseEvent . ctrlKey || // Ctrl key
72+ mouseEvent . shiftKey // Shift key
73+ ) {
74+ window . open ( href , '_blank' ) ;
75+ return ;
76+ }
77+ } else if ( href ) {
6978 window . open ( href , '_blank' ) ;
7079 }
80+
7181 if ( onClick ) {
7282 onClick ( e ) ;
73- }
83+ }
7484 } ;
7585
7686 private renderBadges = ( badges : React . ReactNode [ ] ) => {
You can’t perform that action at this time.
0 commit comments