Skip to content
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

DynamicForm storeLastActiveTab option #1879

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}