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

Picker throws validation errors when only customSource is passed to fromSources #528

Open
pigpudle opened this issue Aug 9, 2023 · 0 comments

Comments

@pigpudle
Copy link

pigpudle commented Aug 9, 2023

Hi!
I'm trying to create a picker with only custom source, I use this guide: https://www.filestack.com/docs/tutorials/picker-custom-source/

This guide works fine & correctly only if I have any other sources passed before custom source in fromSources array:

For example
1) These options work fine:

const options = {
    fromSources: [ 'local_file_system', myNewCustomSource ] // <-- this one works fine, but if I change it to `[ myNewCustomSource, 'local_file_system' ]` it stops working
    maxFiles: 20,
    uploadInBackground: false,
    onUploadDone: (res) => console.log(res),
};

2) These options don't work:

const options = {
    fromSources: [ myNewCustomSource ] // <-- only one single custom source fails
    maxFiles: 20,
    uploadInBackground: false,
    onUploadDone: (res) => console.log(res),
};

The 2nd example throws validation errors like:

  • additionalProperty "label" exists in instance when not allowed (and there are more same errors but about name / icon / mounted props
  • is not one of enum values: local_file_system,url,i…usiness,clouddrive ...

Here is the codesandbox with the bug: https://codesandbox.io/s/dawn-darkness-vd9yv5?file=/src/index.js:4808-4814

Expected Behavior

Single custom source should work without validation errors

Current Behavior

The 2nd example throws validation errors like:

  • additionalProperty "label" exists in instance when not allowed (and there are more same errors but about name / icon / mounted props
  • is not one of enum values: local_file_system,url,i…usiness,clouddrive ...

Possible Solution

Steps to Reproduce (for bugs)

Described above
Here is the codesandbox with the bug: https://codesandbox.io/s/dawn-darkness-vd9yv5?file=/src/index.js:4808-4814

Additional Screenshots

image

image

Context

Your Environment

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

No branches or pull requests

1 participant