Forum Discussion

tom751000's avatar
tom751000
Copper Contributor
Mar 07, 2024

Clicking the title link in the list webpart opens two tabs

Hello
Clicking a link (in a list column) in the list webpart opens in two new tabs.
Devices are iPad and iPhone. This happens in Chrome and Edge browsers. It's normal in Safari.
There is no problem when directly manipulating the list, but this problem occurs when it comes to list parts.
I am formatting the title column.
Does anyone know the cause?
thank you

  • tom751000 

    Usually, the list itself is configured to Open items in a new tab, no adding this code is actually asking it to open it twice.

    try removing the "target": "_blank" attribute from the attributes section in the JSON code. This should make the button open the item in the same tab instead of opening a new tab.

    Below is the modified JSON without the "target": "_blank" attribute, hopefully this works or leads you to a path where you can resolve this

    {
        "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
        "elmType": "button",
        "customRowAction": {
            "action": "defaultClick"
        },
        "attributes": {
            "title": "[$Title]",
            "data-interception": "off",
            "rel": "noopener noreferrer"
        },
        "style": {
            "border": "none",
            "background-color": "transparent",
            "cursor": "pointer"
        },
        "children": [
            {
                "elmType": "div",
                "txtContent": "[$Title]",
                "style": {
                    "white-space": "nowrap",
                    "text-overflow": "ellipsis",
                    "overflow": "hidden",
                    "font-size": "20px"
                }
            }
        ]
    }

     

    • tom751000's avatar
      tom751000
      Copper Contributor

      Sandeep-Pothedar

      thank you for your reply.

      I certainly didn't need "target:_blank".

      I checked it today.
      This behavior no longer occurs for both incoming JSON and older JSON.

      I don't know the cause, but it has been resolved. thank you everyone.

      • ganeshsanap's avatar
        ganeshsanap
        MVP

        tom751000 

         

        Maybe some bug/glitch at Microsoft's end which got resolved with latest updates to SharePoint tenants.

         

        I am glad it is working for you now as expected.


        Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

  • tom751000 Can you share the JSON you have used for formatting the list column?

     

    Most probably the applied JSON formatting is causing this issue.


    Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

    • tom751000's avatar
      tom751000
      Copper Contributor

      ganeshsanap 

      I will share the JSON.
      When I changed the default click to delete, a tab opened with a delete message. It works differently than before.

      {
      "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
      "elmType": "button",
      "customRowAction": {
      "action": "defaultClick"
      },
      "attributes": {
      "title": "[$Title]",
      "target": "_blank",
      "data-interception": "off",
      "rel":"noopener noreferrer"
      },
      "style": {
      "border": "none",
      "background-color": "transparent",
      "cursor": "pointer"
      },
      "children": [
      {
      "elmType": "div",
      "txtContent": "[$Title]",
      "style": {
      "white-space": "nowrap",
      "text-overflow": "ellipsis",
      "overflow": "hidden",
      "font-size": "20px"
      }
      }
      ]
      }

      • ganeshsanap's avatar
        ganeshsanap
        MVP

        tom751000 

         

        By looking at the JSON, it should not open the list forms in new tab. Also, "target": "_blank", is not really supported for button element to open the item in new tab. It should be used with the anchor (a) element.

         

        I will suggest you to raise a support ticket with Microsoft directly and report this behavior while using iPad and iPhoneGet M365 Support - Online Support 


        Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

Resources