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
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!
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:
if (linkBehaviorPref.value === 'newTab') {
window.open(url, '_blank', 'noopener');
} else {
window.location.href = url;
}
this is video for your help
Hey Ajit and team,
Welcome to Retool community!
For your specific request, is there possibly a different component you are using other than the "Link"?
In my own testing, I was able to configure a link component/event handler as seen in the screenshot below. When I disable the toggle for open in a new tab, I was then able to cmd+click on the link to get it to open in a new tab. This then sets the single click on the link to navigate you to a page in the same tab.
I checked this out internally and we had a feature request in the past for it, but it was marked "done". I was able to get this solution to work for me in both Cloud and On-Prem.
So please let me know if possibly this is another component in use, what browser you are using, what version of Retool you are using, and any other details that might help me reproduce this outside of the method listed above ![]()
John | Retool Support