Fix: #221 投稿フォームの時限投稿メニューが動作しない問題 (#223)

This commit is contained in:
KMY(雪あすか) 2023-11-03 09:50:01 +09:00 committed by GitHub
parent 4fdbb159fe
commit 0f85ed243c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -230,7 +230,7 @@ class ComposeForm extends ImmutablePureComponent {
};
handleExpirationPick = (data) => {
const position = this.autosuggestTextarea.textarea.selectionStart;
const position = this.textareaRef.current.selectionStart;
this.props.onPickExpiration(position, data);
};

View file

@ -251,7 +251,7 @@ const insertExpiration = (state, position, data) => {
return state.merge({
text: `${oldText.slice(0, position)} ${data} ${oldText.slice(position)}`,
focusDate: new Date(),
caretPosition: position + data.length + 1,
caretPosition: position + data.length + 2,
idempotencyKey: uuid(),
});
};