Skip to content

Commit

Permalink
Fix: #221 投稿フォームの時限投稿メニューが動作しない問題 (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
kmycode authored Nov 3, 2023
1 parent 4fdbb15 commit 0f85ed2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/mastodon/reducers/compose.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
});
};
Expand Down

0 comments on commit 0f85ed2

Please sign in to comment.