Proposition about onInput/onChange
Open
Nobody has claimed this yet.
Status: Unconfirmed
- Dominant language
- JavaScript
- Stars
- 251k
- Forks
- 51.4k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 53
Description
Hi :)
In ReactDom we can find:
function getTargetInstForInputOrChangeEvent(topLevelType, targetInst) {
if (topLevelType === TOP_INPUT || topLevelType === TOP_CHANGE) {
return getInstIfValueChanged(targetInst);
}
}
Why not adding an extra condition here like:
function getTargetInstForInputOrChangeEvent(topLevelType, targetInst) {
if ((!React.$$useRealOnChange && topLevelType === TOP_INPUT) || topLevelType === TOP_CHANGE) {
return getInstIfValueChanged(targetInst);
}
}
By checking React.$$useRealOnChange in this function, a user could add this line:
React.$$useRealOnChange = true;
anywhere in their code (before or after including ReactDom) to find back the more native behavior.
I'm sorry in advance if this proposition has already been proposed
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
The issue names getTargetInstForInputOrChangeEvent in ReactDom; start there and read the surrounding input/change event handling. Review the discussion for an agreed behavior, then confirm the final decision with coverage for the resulting event semantics.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100