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

FilePicker: onChanged event not firing at all #500

Closed
SemionKovaliov opened this issue Mar 12, 2020 · 4 comments
Closed

FilePicker: onChanged event not firing at all #500

SemionKovaliov opened this issue Mar 12, 2020 · 4 comments

Comments

@SemionKovaliov
Copy link

SemionKovaliov commented Mar 12, 2020

Category

[ ] Enhancement

[x] Bug

[ ] Question

Version

"@pnp/spfx-property-controls": "1.16.0",
"@pnp/spfx-controls-react": "^1.16.0",
"@microsoft/sp-office-ui-fabric-core": "^1.10.0",
"office-ui-fabric-react": "6.189.2",

Expected / Desired Behavior / Question

Clicking on files or uploading files should fire "onChanged" event

Observed Behavior

After click on any file or after attempt to upload "onChanged" event does not fire no matter what

Steps to Reproduce

Added onChanged event in FilePicker props.
Go to "Upload" tab
Select any file and click "Open"

Thanks!

@ghost
Copy link

ghost commented Mar 12, 2020

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

@ghost ghost added the Needs: Triage 🔍 label Mar 12, 2020
@github-actions
Copy link

Thank you for submitting your first issue to this project.

@SemionKovaliov
Copy link
Author

SemionKovaliov commented Mar 13, 2020

I've digged into sp-dev-fx-controls-react/src/controls/filePicker/FilePicker.tsx and found some interesting thing:
there is no mentions of 'onChanged' event. we have it in a props and we can pass it in props but it doing just NOTHING. What the hell is this? Why documentation says that we can pass but it doing nothing.
I just faced with an issue in "Upload" tab. When we are uploading files this tab doesn't show filename which is not user friendly in my point and when i tried to add this filename with "onChanged" event it just doing nothing. Please, is it possible to show filename right in component or add please support of "onChanged" event.
Or correct me please if I'm wrong

@AJIXuMuK
Copy link
Collaborator

Hi @SemionKovaliov!
Thank you for reporting both issues.

I would say that onChanged should be deleted, and onSave should be used instead. FilePicker, at least for now, works as a standalone control, all intermediate operations (like file change) are handled inside the component. And when a user clicks save - then FilePicker returns to the parent its new selection.

Regarding filename - I've created a separate bug #518 to handle it.

What the hell is this? Why documentation says that we can pass but it doing nothing.

Please, be polite to contributors. All of them are spending their own time for free to help others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants