disable selection update on emoji selected for now

this is kind of broken when adding emojis not at the end
pull/2165/head
audric 3 years ago committed by Audric Ackermann
parent 78b84d4ed8
commit 5b34419461
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -986,15 +986,15 @@ class CompositionBoxInner extends React.Component<Props, State> {
// update our selection because updating text programmatically // update our selection because updating text programmatically
// will put the selection at the end of the textarea // will put the selection at the end of the textarea
const selectionStart = currentSelectionStart + Number(colons.length); // const selectionStart = currentSelectionStart + Number(1);
messageBox.selectionStart = selectionStart; // messageBox.selectionStart = selectionStart;
messageBox.selectionEnd = selectionStart; // messageBox.selectionEnd = selectionStart;
// Sometimes, we have to repeat the set of the selection position with a timeout to be effective // // Sometimes, we have to repeat the set of the selection position with a timeout to be effective
setTimeout(() => { // setTimeout(() => {
messageBox.selectionStart = selectionStart; // messageBox.selectionStart = selectionStart;
messageBox.selectionEnd = selectionStart; // messageBox.selectionEnd = selectionStart;
}, 20); // }, 20);
} }
private focusCompositionBox() { private focusCompositionBox() {

Loading…
Cancel
Save