Prevent redirection when clicking on Document Name in Document Library web part
Question
I have built connected web parts between Document Library and File Viewer. On selection of document check box it is opening the selected document in File Viewer web part.
When I click on Document Name it is opening the file in new browser.
Is it possible to restrict the redirection and just show the content in the File Viewer web part only?
No correct solution
OTHER TIPS
This is the excepted behavior for the document library Name column, since it is linked to document with edit menu:
As a workaround, we could use column formatting to make the Name field in current library not redirect when clicked once:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "a",
"txtContent": "@currentField",
"attributes": {}
}
Simple test:
Note that if you double-click the name, it will still open the document in the browser.
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange