1
0
Fork 0

Better handleBlur handler

This commit is contained in:
Ava Wroten 2020-03-04 10:47:38 -06:00
parent ab7b25882b
commit 579283f0ba

View file

@ -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;
}
}
```