Skip to content

Commit

Permalink
DynamicForm storeLastActiveTab option
Browse files Browse the repository at this point in the history
New option to set the storeLastActiveTab property of the FilePicker within the DynamicForm.
  • Loading branch information
IRRDC committed Sep 3, 2024
1 parent 1bd4601 commit 7f63687
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/documentation/docs/controls/DynamicForm.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
1 change: 1 addition & 0 deletions src/controls/dynamicForm/DynamicForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1439,6 +1439,7 @@ export class DynamicForm extends React.Component<
hideLinkUploadTab={true}
hideSiteFilesTab={true}
checkIfFileExists={true}
storeLastActiveTab={this.props.storeLastActiveTab ?? true}
/>
{selectedFile && <div className={styles.selectedFileContainer}>
<Icon iconName={this.getFileIconFromExtension()} />
Expand Down
6 changes: 6 additions & 0 deletions src/controls/dynamicForm/IDynamicFormProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 7f63687

Please sign in to comment.