[material-ui] Standardize event handler callbacks

Open
#41,925 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Refactor
Clarity
Needs clarification
Activity status
Stale
Tech stack
javascript, react
Domain
frontend

Research direction

Start by reviewing the marked callback in packages/mui-material/src/internal/SwitchBase.js and the Select callback in packages/mui-material/src/Select/SelectInput.js. Read the Base UI refactor context and related pull request #40210. Done means agreeing on a consistent callback-signature strategy across the library and its Base UI integration.

Written by the indexing model from the issue text.

Description

scope: all components type: enhancement

Review, design, and standardize the event handler callback signatures across the library.

Some are marked to be modified: https://github.com/mui/material-ui/blob/next/packages/mui-material/src/internal/SwitchBase.js#L116-L119

While others aren't: https://github.com/mui/material-ui/blob/next/packages/mui-material/src/Select/SelectInput.js#L258

With the Base UI refactor on the horizon, this issue should be handled alongside it, as it will be tightly related. For example, while working on https://github.com/mui/material-ui/pull/40210, one of the blockers was that the Select component's onChange second argument was not supported by Base UI.

Overall, we should decide the optimal way to support custom callback signatures or if we should only rely on events API.

Search keywords:

Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

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.

More from mui/material-ui

All issues in mui/material-ui

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.