Skip to content

Commit 91c75bc

Browse files
SaraVieiraCompuIves
authored andcommitted
add cmd+click for opning in new tab (codesandbox#1687)
1 parent 0d225d8 commit 91c75bc

File tree

1 file changed

+6
-2
lines changed
  • packages/app/src/app/pages/Dashboard/Content/SandboxCard

1 file changed

+6
-2
lines changed

packages/app/src/app/pages/Dashboard/Content/SandboxCard/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,15 @@ class SandboxItem extends React.PureComponent<Props> {
282282
});
283283
};
284284

285-
openSandbox = (openNewWindow = false) => {
285+
openSandbox = (e, openNewWindow = false) => {
286+
// check for cmd click
287+
const cmd = e.ctrlKey || e.metaKey;
286288
// Git sandboxes aren't shown here anyway
287289
const url = sandboxUrl({ id: this.props.id });
290+
288291
if (!this.props.removedAt) {
289-
if (openNewWindow === true) {
292+
if (openNewWindow === true || cmd) {
293+
track('Dashboard - Sandbox Opened in a new tab');
290294
window.open(url, '_blank');
291295
} else {
292296
history.push(url);

0 commit comments

Comments
 (0)