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

docs(picker): validateFileExtensionOnly field in interface #471

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
9 changes: 9 additions & 0 deletions src/lib/picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,15 @@ export interface PickerOptions {
* ```
*/
acceptFn?: (PickerFileMetadata, PickerAcceptFnOptions) => Promise<string>;

/**
* When true, file's format are validated only by extension instead of MIME type.
* Note, that in accept array only exact file extensions are going to be validated -
* MIME types groups such as ["image/jpeg"] will be omitted.
* Default false.
*/
validateFileExtensionOnly?: boolean;

/**
* Prevent modal close on upload failure and allow users to retry.
*/
Expand Down
3 changes: 3 additions & 0 deletions src/schema/picker.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ export const PickerParamsSchema = {
acceptFn: {
format: 'callback',
},
validateFileExtensionOnly :{
type: 'boolean'
},
fromSources: {
type: 'array',
items: [
Expand Down