Forum Discussion
tom751000
Mar 07, 2024Copper Contributor
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 proble...
Sandeep-Pothedar
Mar 10, 2024Copper Contributor
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
Mar 10, 2024Copper 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.
- ganeshsanapMar 10, 2024MVP
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.
- tom751000Mar 11, 2024Copper Contributor
very sorry.
my misunderstanding.I checked the operation in Safari. As expected, in Chrome and Edge for iPad and iPhone, two tabs open from the list web part.
Even if I implemented defaultClick on the new column, two tabs opened.
- tom751000Mar 11, 2024Copper ContributorI found that this happens with the standard list web part without any JSON customization.
When using Chrome and Edge on iPad and iPhone,
Double tapping on a row behaves strangely.
Two tabs will open. JSON seems irrelevant.
I am currently asking MS Support again.