salesforce / salesforce/design-system-react

ColorPicker component has typescript errors for the methods in the event props

Open
#3,020 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
982
Forks
440
Avg merge
1d 21h
Merged PRs (30d)
4

Description

Our team uses SLDS react components in a typescript environment and we are seeing a few typescript errors on certain props in the ColorPicker component that uses event handlers. Issues are happening in the event props for the following event handlers: onChange, onClose, onOpen, onRequestClose, onWorkingColorChange. This is due to the types for those props only take in one parameter, e.g. onChange?: (v: any) => any; instead of having an additional event parameter for the handler. We recently fixed some other components in a seperate Issue/PR that was merged, here. This makes our linting tools fail in our CI/CD. Here are some snapshots of the error.

Screen Shot 2022-03-10 at 10 51 15 AM
Screen Shot 2022-03-10 at 10 51 58 AM

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

Locate the ColorPicker component and its TypeScript event-prop declarations, then compare the related fixes in issue/PR 2969. Update the types for onChange, onClose, onOpen, onRequestClose, and onWorkingColorChange so their signatures match the handlers, and verify that the reported TypeScript and linting errors are resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.