pnp / pnp/sp-dev-fx-controls-react

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

Open
#2,062 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
433
Forks
418
Avg merge
5d 6m
Merged PRs (30d)
19

Description

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!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the DynamicForm implementation and trace the enableFileSelection file-picker flow. Reproduce the issue in a React SPA using the steps provided, then inspect what happens when a source such as OneDrive or “From this device” is selected. Done means the picker no longer causes a route change or loses SPA state.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.