-
Notifications
You must be signed in to change notification settings - Fork 380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FieldNameRenderer fails to encode URI when hasPreview={true} #296
Comments
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible. |
As a workaround I'm using the onClick and onDoubleClick callbacks then setting location.hash for documents I set islink=true and hasPreview=true public onClickPreview(args: IFieldNameClickEventArgs): any {
const parts: Array<string> = args.filePath.split('/');
const parentPath: string = parts.slice(0, Math.max(parts.length - 1, 0)).join('/');
location.hash = `#id=${encodeURIComponent(args.filePath)}&parent=${encodeURIComponent(parentPath)}`;
return {};
} and for Folders I set isLink=true and hasPreview=false public onClickFolder(args: IFieldNameClickEventArgs): any {
location.hash = `#id=${encodeURIComponent(args.filePath)}`;
return {};
} |
This fix has now been merged and will be available in the new release. You can already test it out by installing the latest beta version. More information on how you can test out a beta version can be found here: https://sharepoint.github.io/sp-dev-fx-controls-react/beta/ |
This has just been released in the version |
Category
[ ] Enhancement
[x] Bug
[ ] Question
Version
Please specify what version of the library you are using: [ 1.13.1 ]
(using SharePoint Framework 1.8.1 as well)
Expected / Desired Behavior / Question
Using the FieldNameRenderer (documentation here) to override the FileLeafRef / LinkFilename / LinkFilenameNoMenu controls should allow document previewing in sub-folders.
i.e. left click on a folder -> navigates you to the sub folder. left click on a document -> show document preview.
Observed Behavior
The URL's generated by the isLink={true} option fail to be URI encoded when paired with hasPreview={true}. SharePoint Online appears to have trouble with these links and displays the error message 'This item might not exist or is no longer available'.
The HREF attribute is set to
rather than what SharePoint Online does which is calling encodeURIComponent on the parameters
Steps to Reproduce
This occurs in debug mode and also once deployed as an App to a site.
Setting the ClientSideComponentId for the FileLeafRef field can be done by using the PnP powershell lib and this command (substitute your own app id) . Note the inclusion of the flag '-UpdateExistingLists'.
The text was updated successfully, but these errors were encountered: