`hasKeyboardFocus` can return null and `!null` is true. The check should be:

```javascript
if (this.hasKeyboardFocus() === 0) {
```