Form input name='nodeName' breaks onSubmit event handling
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 251k
- Forks
- 51.4k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 53
Description
It happened that I stumbled on following edge case. If you add name='nodeName' attribute to form's input, at some point of React event handling (ChangeEventPlugin.js: shouldUseChangeEvent()) it will call: elem.nodeName && elem.nodeName.toLowerCase(), but coincidentally nodeName property refers to input and invocation fails.
Here's a jsFiddle example
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 the jsFiddle reproduction and inspect ChangeEventPlugin.js, especially shouldUseChangeEvent(), where the input's nodeName is accessed. Confirm the failure when a form input is named nodeName, then verify that onSubmit and related event handling work without that collision.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100