cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DE1
Level: Powered On

Prevent HTML links from opening a new tab

I am using a simple anchor link and mailto link, in an HTML Text control:

 

"Primary Contact: <a href=#>" & PrimaryContact.first_name & " " &PrimaryContact.last_name & "</a>

<br>" & "Email: <a href=mailto:" & PrimaryContact.email & ">"& PrimaryContact.email &"</a>"

 

Both of them cause my browser (Chrome) to open a new tab. The anchor link opens PowerApps Studio in a new tab. Why? I want the anchor link to simply select an item in my gallery. And I've set Outlook desktop as my default email client so not sure why it opens a blank tab for that either (although it does open Outlook too)?

 

Is there a way to prevent HTML links from opening a new tab when used in powerapps? I know I could use blue, underlined text as a workaround but then the mouse pointer doesn't change when you hover over the 'link'.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Prevent HTML links from opening a new tab

Hi @DE1 

 

If you want to open the links in another tab, you can use Launch("URL") function. By using Launch all the pages will be opened in a single tab, but if you want to open different URLs in different tabs, then you can use Download("URL").
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
6 REPLIES 6
Community Support Team
Community Support Team

Re: Prevent HTML links from opening a new tab

Hi @DE1 ,

Do you want to prevent opening a new tab by clicking on the html text?

Have you set the html text's OnSelect or other properties?
If you do not set the html text's OnSelect to Launch function(for example), it will not open a new tab by clicking on the control.

 

Best regards,

Community Support Team _ Phoebe Liu

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
DE1
Level: Powered On

Re: Prevent HTML links from opening a new tab

Hi @v-yutliu-msft,

 

I'm not using OnSelect or Launch, just the raw html. And I don't want any tab to open when I click on either link.

Super User
Super User

Re: Prevent HTML links from opening a new tab

Hi @DE1 

 

As per microsoft documentation, they have suggested not to use <a> anchor tag in the HTML texts, they do not perform as expected.  The TabIndex system in PowerApps does not consider elements inside HtmlText. 
dnl.png

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Highlighted
DE1
Level: Powered On

Re: Prevent HTML links from opening a new tab

Thanks, then how do you do links in PowerApps?

Sijts
Level 8

Re: Prevent HTML links from opening a new tab

by using Launch()

 

this way you can open a URL link. 

Super User
Super User

Re: Prevent HTML links from opening a new tab

Hi @DE1 

 

If you want to open the links in another tab, you can use Launch("URL") function. By using Launch all the pages will be opened in a single tab, but if you want to open different URLs in different tabs, then you can use Download("URL").
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 115 members 4,421 guests
Please welcome our newest community members: