Description
Category
[x] Enhancement
[x] Bug
[ ] Question
Not sure if I would call this a bug. It certainly is unexpected behavior though.
Version
Please specify what version of the library you are using: 3.18.1
It's not resolved in the latest version 3.19.
Expected / Desired Behavior / Question
I can use the Dynamic Form on a library for creating document sets. However, the document sets will always be created in the root of the library. Even if I've clicked the new button from a subfolder. I'd like to be able to create something in the folder where I currently am located.
Observed Behavior
A document set, created using a dynamic form, is always created in the root of the library.
Steps to Reproduce
- Add the document set feature to a sharepoint site / library.
- Add a dynamic form in your spfx solution, using the contentTypeId of the document set.
- Navigate to a subfolder in the library. Click new
- Create the document set using the dynamic form.
Location in code
The location where this goes wrong:
https://github.com/pnp/sp-dev-fx-controls-react/blob/master/src/controls/dynamicForm/DynamicForm.tsx#L590C11-L592C13
const newFolder = await library.rootFolder.addSubFolderUsingPath(
folderTitle
);
It should take into account the RootFolder
of the form, which can be a subfolder of the library. This information is available as a querystring variable.