Open New Tab on Command+Click

My goal:
I want to open a new tab only when the user command+clicks on a component. Currently, when enabling the Open a New Tab flag, a new tab is opened when the user just clicks on it.

Any ideas on how I can achieve this would be great

We’ve run into the same issue. our solution is to create a settings cog for users and let them choose their desired way to open tabs (single page vs open in new page)

you can manage this with a DB or with local storage. I know its not the desired way but that’s the work around we’ve been using

Let me know if you need any more details!

1 Like

Provid

e a small settings control where users choose Same Tab or New Tab. Store the choice in a variable or database; then in button click logic, open accordingly. This doesn't implement Command/Ctrl+Click detection, but gives practical control in Retool today.

Pattern:

  • Variable: linkBehaviorPref = 'sameTab' | 'newTab'
  • onClick handler:
if (linkBehaviorPref.value === 'newTab') {
  window.open(url, '_blank', 'noopener');
} else {
  window.location.href = url;
}

this is video for your help