Skip to content

DynamicForm: File picker route change issue when using enableFileSelection in SPA #2062

@urwahumer

Description

@urwahumer

Thank you for reporting an issue, suggesting an enhancement, or asking a question. We appreciate your feedback - to help the team understand your
needs please complete the below template to ensure we have the details to help. Thanks!

Please check out the documentation
to see if your question is already addressed there. This will help us ensure our documentation is up to date.

Category

[ ] Enhancement
[x] Bug
[ ] Question

Version

Please specify what version of the library you are using: [ e.g., 3.21.0 ]

If you are not using the latest release, please update and see if the issue is resolved before submitting an issue.

Expected / Desired Behavior

When using the enableFileSelection parameter in DynamicForm, the file picker should allow selecting a file from OneDrive, local device, or other sources without causing a route change in a single-page application (SPA).

Observed Behavior

The form renders correctly and shows the file selection button. However, once the file picker modal opens and a user clicks on a source (e.g., OneDrive, "From this device", etc.), the SPA route changes — similar to full navigation — causing the page to reload and lose context.
This behavior breaks the SPA flow since the page and component state are lost after the route change.

Steps to Reproduce

Create a React SPA using SPFx and include a DynamicForm component.

Set enableFileSelection: true, and configure contentTypeId and supportedExtensions.

Run the app and open the form.

Click the file selection button.

In the modal, choose a file source like OneDrive or another provider.

Observe that the route changes and the SPA reloads.

Submission Guidelines

Delete this section after reading

All suggestions, questions and issues are welcome, please let us know what's on your mind.

Remember to include sufficient details and context.

If you have multiple suggestions, questions, or bugs please submit them in separate issues so we can track resolution.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions