1

I have a SharePoint Online Modern page that has multiple Quick Links web parts.

Over the last two days users (using Chrome browser) have started reporting that the links they are clicking on are opening incorrect links (they open other Quick Links from the same page).

Hovering over the link before clicking on it shows the desired link in the browser ‘status’ bar.

The issue is temporarily resolved by opening Chrome dev tools and doing a hard refresh, or a work around is right clicking and opening links in new tab.

My theory is that clicking on a Quick Link to open a list or document and then pressing back in the browser is somehow modifying the links (from the browser perspective), or that they aren't being handled properly (maybe something to do with window pop or pushstate?).

Has anyone else experienced this and know of a solution?

I am currently researching how I can set all Quick Links to open in target="_blank", but it looks like that is not an option in Modern pages.

7
  • 1
    We've been experiencing this all week. Quick launch links look good but then redirect to a system page instead of the Document library. Site Contents link under the Cog Wheel menu leads to random pages. Very strange behavior happening I assumed it was a bug MS will fix.. Jun 5, 2020 at 15:07
  • Glad to know issue is being experienced by others (although I haven’t seen the issue reported anywhere else), I’ve also wondered if it was possibly something to do with zscaler and some sort of cache problem. Users are getting really fed up with it, and I’ve had to put a message at top of page directing them to manually open links in new tab. Jun 6, 2020 at 11:25
  • Can you provide a few examples of which url do u have in the link? thanks
    – Alberto S.
    Jun 8, 2020 at 10:05
  • @AlbertoS. - they are all links to either: Word or PDF documents in a SharePoint folder or SharePoint lists or forms. The documents are linked to by selecting them from the Recent area shown when adding a quick link. The lists hyperlinks have the URL format ending in AllItems.aspx whereas the corresponding forms end in NewForm.aspx. When back at computer I will confirm other components of the list and form URLs, but from memory they are just like this: https://companyname.sharepoint.com/sites/site-name/Lists/list%20name/AllItems.aspx Jun 8, 2020 at 11:15
  • it would be better if you could provide at least a real example of a problematic url, thanks
    – Alberto S.
    Jun 8, 2020 at 12:03

2 Answers 2

2

Regarding opening the links in a new tab, As mentioned in this user story, this is the OOTB behavior from Microsoft.

In modern pages, we open links within SharePoint in the same tab by default, and external links in a new tab. In the text web part, users can specify to open links in a new tab, but that isn’t the default behavior. Similarly, for navigation links, they follow the same rule (within SharePoint, same tab, external to SharePoint in a new tab). This is true of the modern web parts that support linking as well (hero, quick links, images, etc.) This is the pattern we’ve adopted for consistency

Here is a similar requirement where they mentioned that for now, as a workaround, to open a link (internal or external) in a new tab or window, you may use the web browser feature where you right-click on the link and it gives you options to choose from.

2
  • The question is regarding erroneous behaviour where clicking on a Quick Link opens the wrong URL even though the underlying URL is displayed correctly in the Status bar when hovering over the link, it is not about the default Quick Links behaviour of links opening in the same tab. Jun 1, 2020 at 5:56
  • I know but I added it as you have mentioned that you are exploring ways to open the links in the new tab. Jun 1, 2020 at 5:58
1

I have tested that quick Links webpart on a test sharepoint online site. I created the links following this example:

  • "Documents Library" => /sites/[my-site]/Shared%20Documents
  • "List" => /sites/[my-site]/List
  • "New List item" => /sites/[my-site]/List/NewForm.aspx

If this still doesnt work, you can transform the href with the help of javascript:

var qlinks = document.querySelectorAll("div[data-sp-feature-tag^=QuickLinksWebPart] a")
for (i = 0; i < qlinks.length; i++) {
  qlinks[i].onclick = "javascript:location.href='"+ qlinks[i].href+"'";
  qlinks[i].href=""; 
} 

You can insert that javascript with some other webpart, or a spfx extension. It will only modify the quicklink's webpart links ;)

2
  • it is my understanding we cannot add any JavaScript in Modern sites anymore (without writing custom web parts etc). Does your solution require a Classic site and the use of SharePoint Designer? If not, I’d be very excited to learn that I could easily add JavaScript (maybe even jQuery) to Modern sites. Jun 10, 2020 at 9:28
  • 1
    nope. As I said, you can inject this code in modern experience creating your own spfx app customizer extension, or you can install some webpart from the community, that easily allows u to add custom JS, as this one github.com/pnp/sp-dev-fx-webparts/tree/master/samples/…
    – Alberto S.
    Jun 10, 2020 at 10:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.