salesforce / salesforce/design-system-react
onRequestClose vs onClose callbacks
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 982
- Forks
- 440
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 4
Description
I propose that callbacks that handle state use the onRequest prefix and occur before the event and callbacks that are run after the "event" happens just be prefixed with on.
Consider a use case when a parent component wants to control Popover or Dropdown with isOpen. I get confused myself on when these callbacks occur and have to look at the source.
See item 3 in contributing docs about Controlled components
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with item 3, “Controlled and Uncontrolled Components,” in CONTRIBUTING.md, then inspect the Popover and Dropdown entry points mentioned in the issue. Compare when their onRequestClose and onClose callbacks run and determine the agreed naming convention and component scope before changing anything.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100