From 7f636877fcfed60357ff90e945a6a81e6fc7ac91 Mon Sep 17 00:00:00 2001 From: IRRDC Date: Tue, 3 Sep 2024 09:53:32 +0200 Subject: [PATCH] DynamicForm storeLastActiveTab option New option to set the storeLastActiveTab property of the FilePicker within the DynamicForm. --- docs/documentation/docs/controls/DynamicForm.md | 1 + src/controls/dynamicForm/DynamicForm.tsx | 1 + src/controls/dynamicForm/IDynamicFormProps.ts | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/docs/documentation/docs/controls/DynamicForm.md b/docs/documentation/docs/controls/DynamicForm.md index 0760d91c4..1957dfb9a 100644 --- a/docs/documentation/docs/controls/DynamicForm.md +++ b/docs/documentation/docs/controls/DynamicForm.md @@ -65,6 +65,7 @@ The `DynamicForm` can be configured with the following properties: | saveDisabled | boolean | no | Specifies if save button is disabled. | | validationErrorDialogProps | IValidationErrorDialogProps | no | Specifies validation error dialog properties | | customIcons | { [ columnInternalName: string ]: string } | no | Specifies custom icons for the form. The key of this dictionary is the column internal name, the value is the Fluent UI icon name. | +| storeLastActiveTab | boolean | no | When uploading files: Specifies if last active tab will be stored after the Upload panel has been closed. Note: the value of selected tab is stored in the queryString hash. Default - `true` | ## Validation Error Dialog Properties `IValidationErrorDialogProps` | Property | Type | Required | Description | diff --git a/src/controls/dynamicForm/DynamicForm.tsx b/src/controls/dynamicForm/DynamicForm.tsx index fc8a54835..724f6bdf3 100644 --- a/src/controls/dynamicForm/DynamicForm.tsx +++ b/src/controls/dynamicForm/DynamicForm.tsx @@ -1439,6 +1439,7 @@ export class DynamicForm extends React.Component< hideLinkUploadTab={true} hideSiteFilesTab={true} checkIfFileExists={true} + storeLastActiveTab={this.props.storeLastActiveTab ?? true} /> {selectedFile &&
diff --git a/src/controls/dynamicForm/IDynamicFormProps.ts b/src/controls/dynamicForm/IDynamicFormProps.ts index 7198c9e7b..0c9cdcff1 100644 --- a/src/controls/dynamicForm/IDynamicFormProps.ts +++ b/src/controls/dynamicForm/IDynamicFormProps.ts @@ -133,4 +133,10 @@ export interface IDynamicFormProps { */ fieldOrder?: string[] + /** + * When uploading files: Specifies if last active tab will be stored after the Upload panel has been closed. + * Note: the value of selected tab is stored in the queryString hash. + * @default true + */ + storeLastActiveTab?: boolean; }