parent
4fdbb159fe
commit
0f85ed243c
2 changed files with 2 additions and 2 deletions
|
@ -230,7 +230,7 @@ class ComposeForm extends ImmutablePureComponent {
|
||||||
};
|
};
|
||||||
|
|
||||||
handleExpirationPick = (data) => {
|
handleExpirationPick = (data) => {
|
||||||
const position = this.autosuggestTextarea.textarea.selectionStart;
|
const position = this.textareaRef.current.selectionStart;
|
||||||
|
|
||||||
this.props.onPickExpiration(position, data);
|
this.props.onPickExpiration(position, data);
|
||||||
};
|
};
|
||||||
|
|
|
@ -251,7 +251,7 @@ const insertExpiration = (state, position, data) => {
|
||||||
return state.merge({
|
return state.merge({
|
||||||
text: `${oldText.slice(0, position)} ${data} ${oldText.slice(position)}`,
|
text: `${oldText.slice(0, position)} ${data} ${oldText.slice(position)}`,
|
||||||
focusDate: new Date(),
|
focusDate: new Date(),
|
||||||
caretPosition: position + data.length + 1,
|
caretPosition: position + data.length + 2,
|
||||||
idempotencyKey: uuid(),
|
idempotencyKey: uuid(),
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue