Skip to content

Incorrect argument type for Filepicker onSelect #56

Description

@zgeorgebrandcoders

onSelect supplies you with the selected file from whatever integration you were interacting with as an argument to the callback you define. The type for the argument says that it is a native JS File type, but this doesn't match what is actually returned. The object that came back doesn't sufficiently overlap with the native File type.

Steps to reproduce:

  1. Authenticate with Google Drive from the file picker
  2. Select a file
  3. console.log() what is being passed to the onSelect function
onSelect: (file) => {
  console.log(file)
}

Example of what object I'm receiving:

{
  "id": "-redacted-",
  "type": "file",
  "mime_type": "-redacted-",
  "name": "-redacted-",
  "size": 0,
  "downloadable": true,
  "owner": {
    "id": "-redacted-",
    "email": "-redacted-",
    "name": "-redacted-"
  },
  "parent_folders": [
    {
      "id": "-redacted-"
    }
  ],
  "parent_folders_complete": false,
  "permissions": {
    "download": true
  },
  "exportable": false,
  "export_formats": [],
  "created_at": "2023-11-27T16:30:03.266Z",
  "created_by": "01702477334330046076",
  "updated_at": "2023-11-27T16:30:03.266Z",
  "updated_by": "01702477334330046076"
}

Example of JS File type:

{
 "lastModified": 0
 "name": "-redacted-"
 "size": 0
 "type": "-redacted-"
 "webkitRelativePath": "-redacted-"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions