googleworkspace / googleworkspace/drive-picker-element

Gaps in React wrapper

Open
#116 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
67
Forks
8
PR merge metrics
No merged PRs in 30d

Description

Two gaps in the wrapper at v0.2.0 that I had to work around:

  1. picker-error is not surfaced as an on… prop. The underlying <drive-picker> element does dispatch picker-error CustomEvents — they're just not in DrivePickerEventHandlers. To preserve the iframe-side authorization-error signal, I attach a manual picker-error listener via a container ref + querySelector("drive-picker"). Worth filing upstream — onError should be a first-class prop alongside onPicked / onCanceled / onOauthError.

  2. visible is not a prop. The wrapper renders <drive-picker> but doesn't forward a ref or expose visibility. Per the element's README, visible must be set imperatively on the DOM node. The same effect that wires the picker-error listener also sets element.visible = true. The dialog closes by flipping our local pickerOpen state on any of onPicked / onCanceled / onOauthError / picker-error, which unmounts the wrapper.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the React wrapper's DrivePickerEventHandlers definition and wrapper entry point, then read the drive-picker element README for the visible property and event behavior. Confirm how onPicked, onCanceled, and onOauthError are exposed and how the wrapper renders the custom element. Done means picker-error is available through a first-class handler and visible can be controlled through the wrapper.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.