Skip to content

Suggestion: The handleChange would be useful as a prop for the contentExplorer #3839

@Lukortech

Description

@Lukortech

I am working with Box Api using the scaffolding and building the appliction from different elements.
My suggestion would be to add an event that'd allow developers to control the selection of contentUploader via props passed down or at least be able to hook onto an event that's exposed at the top level.

I went through the docs and was really surprised not to see a simple code to work;

this.currentContentExplorer = new Box.ContentExplorer();
this.currentContentExplorer.on('chooseFiles', (files: Entry[]) => {
  if(customValidation(files)) this.attachmentsService.upload(files);
});

OR

this.currentContentExplorer = new Box.ContentExplorer();
this.contentExplorerProps = {
  contentUploaderProps: {
    onSelection: (selectedFiles: Entries[]) => boolean; // tells if the files selected are valid to be displayed in the list
  }
}
this.currentContentExplorer.show(
  this.getCurrentFolderId(),
  this.ssoService.refreshedToken),
  this.contentExplorerProps
);

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