ElemeFE / ElemeFE/element-react
Dialog: close modal by pressing ESC don't work
Open
- Dominant language
- JavaScript
- Stars
- 2.8k
- Forks
- 435
- PR merge metrics
- No merged PRs in 30d
Description
### Description
Can't close Dialog modal by pressing ESC button
### Reproduce Steps
1. Open Dialog [https://elemefe.github.io/element-react/index#/en-US/dialog](url)
2. Try to close it by pressing ESC button
### Solution
It seems like the Refs to that element is not part of the DOM yet when we call componentDidUpdate method.
Adding tabIndex attribute and some delay before setting focus to that modal solve this problem.

Contributor guide
Assessment
This issue has not been assessed yet.