From 5b344194612029af404f2c31ab5f37f59f67a43a Mon Sep 17 00:00:00 2001 From: audric Date: Wed, 9 Feb 2022 13:14:58 +1100 Subject: [PATCH] disable selection update on emoji selected for now this is kind of broken when adding emojis not at the end --- .../composition/CompositionBox.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ts/components/conversation/composition/CompositionBox.tsx b/ts/components/conversation/composition/CompositionBox.tsx index 04ea3135e..fd2f5a40b 100644 --- a/ts/components/conversation/composition/CompositionBox.tsx +++ b/ts/components/conversation/composition/CompositionBox.tsx @@ -986,15 +986,15 @@ class CompositionBoxInner extends React.Component { // update our selection because updating text programmatically // will put the selection at the end of the textarea - const selectionStart = currentSelectionStart + Number(colons.length); - messageBox.selectionStart = selectionStart; - messageBox.selectionEnd = selectionStart; - - // Sometimes, we have to repeat the set of the selection position with a timeout to be effective - setTimeout(() => { - messageBox.selectionStart = selectionStart; - messageBox.selectionEnd = selectionStart; - }, 20); + // const selectionStart = currentSelectionStart + Number(1); + // messageBox.selectionStart = selectionStart; + // messageBox.selectionEnd = selectionStart; + + // // Sometimes, we have to repeat the set of the selection position with a timeout to be effective + // setTimeout(() => { + // messageBox.selectionStart = selectionStart; + // messageBox.selectionEnd = selectionStart; + // }, 20); } private focusCompositionBox() {