cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

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
Highlighted
Dual Super User
Dual Super User

Re: Prevent HTML links from opening a new tab

Hi @Anonymous 

 

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!

View solution in original post

6 REPLIES 6
Community Support
Community Support

Re: Prevent HTML links from opening a new tab

Hi @Anonymous ,

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.
Highlighted
Anonymous
Not applicable

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.

Highlighted
Dual Super User
Dual Super User

Re: Prevent HTML links from opening a new tab

Hi @Anonymous 

 

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
Anonymous
Not applicable

Re: Prevent HTML links from opening a new tab

Thanks, then how do you do links in PowerApps?

Highlighted
Resolver II
Resolver II

Re: Prevent HTML links from opening a new tab

by using Launch()

 

this way you can open a URL link. 

Highlighted
Dual Super User
Dual Super User

Re: Prevent HTML links from opening a new tab

Hi @Anonymous 

 

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!

View solution in original post

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (9,817)