Better handleBlur handler
This commit is contained in:
parent
ab7b25882b
commit
579283f0ba
1 changed files with 3 additions and 1 deletions
|
@ -56,7 +56,9 @@ export default class MyComponent extends Component {
|
|||
handleFocus() { this.myButtonHasFocus = true; }
|
||||
|
||||
@action
|
||||
handleBlur() { this.myButtonHasFocus = false; }
|
||||
handleBlur({ target, relatedTarget }) {
|
||||
if (!target.contains(relatedTarget)) this.myButtonHasFocus = false;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue