No blur event fired when button is disabled/removed
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 251k
- Forks
- 51.4k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 53
Description
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
When a focussed button becomes disabled, React does not dispatch a blur event.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template: https://jsfiddle.net/reactjs/69z2wepo/).
- Attach a blur event to a button
- Focus the button
- Make the button disabled or remove it from the DOM
What is the expected behavior?
A blur event will be dispatched.
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
15.1.0, not sure if it worked in previous versions.
Isolated test case: http://jsbin.com/fuvite/1/edit?html,css,js,output
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 isolated test case at http://jsbin.com/fuvite/1/edit and reproduce the behavior using React 15.1.0. Check the focus and blur handling for a button that is disabled or removed after gaining focus. Done means the expected blur event is dispatched in both scenarios, with regression coverage for the reported steps.
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
- 45/100