Fix TypeError in Composer.focus
Uncaught (in promise) TypeError: this.textInput.current is null
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user