mirror of
https://git.sr.ht/~emersion/gamja
synced 2025-03-25 06:21:18 -04:00
Fix TypeError in Composer.focus
Uncaught (in promise) TypeError: this.textInput.current is null
This commit is contained in:
parent
c9b07efc9c
commit
2941dc0076
1 changed files with 3 additions and 0 deletions
|
@ -71,6 +71,9 @@ export default class Composer extends Component {
|
|||
}
|
||||
|
||||
focus() {
|
||||
if (!this.textInput.current) {
|
||||
return;
|
||||
}
|
||||
document.activeElement.blur(); // in case we're read-only
|
||||
this.textInput.current.focus();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue