[FIX] App crash with backspace on input message (#906)

* Fix - App crash with backspace on input message

* Improving code to fix backspace bug

* Fix destructuring undefined

* Improvement code to fix backspace bug
This commit is contained in:
Djorkaeff Alexandre 2019-05-30 14:19:26 -03:00 committed by Diego Mello
parent 29286e98a8
commit 957182bf55
1 changed files with 1 additions and 1 deletions

View File

@ -188,7 +188,7 @@ class MessageBox extends Component {
this.handleTyping(!isTextEmpty); this.handleTyping(!isTextEmpty);
this.setInput(text); this.setInput(text);
if (this.component) { if (!isTextEmpty) {
const { start, end } = this.component._lastNativeSelection; const { start, end } = this.component._lastNativeSelection;
const cursor = Math.max(start, end); const cursor = Math.max(start, end);
const lastNativeText = this.component._lastNativeText; const lastNativeText = this.component._lastNativeText;