From 0f85ed243c099b6726a2c29a230292d419992c82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KMY=EF=BC=88=E9=9B=AA=E3=81=82=E3=81=99=E3=81=8B=EF=BC=89?= Date: Fri, 3 Nov 2023 09:50:01 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20#221=20=E6=8A=95=E7=A8=BF=E3=83=95?= =?UTF-8?q?=E3=82=A9=E3=83=BC=E3=83=A0=E3=81=AE=E6=99=82=E9=99=90=E6=8A=95?= =?UTF-8?q?=E7=A8=BF=E3=83=A1=E3=83=8B=E3=83=A5=E3=83=BC=E3=81=8C=E5=8B=95?= =?UTF-8?q?=E4=BD=9C=E3=81=97=E3=81=AA=E3=81=84=E5=95=8F=E9=A1=8C=20(#223)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mastodon/features/compose/components/compose_form.jsx | 2 +- app/javascript/mastodon/reducers/compose.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/javascript/mastodon/features/compose/components/compose_form.jsx b/app/javascript/mastodon/features/compose/components/compose_form.jsx index 36c25d78dd..03ae26b922 100644 --- a/app/javascript/mastodon/features/compose/components/compose_form.jsx +++ b/app/javascript/mastodon/features/compose/components/compose_form.jsx @@ -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); }; diff --git a/app/javascript/mastodon/reducers/compose.js b/app/javascript/mastodon/reducers/compose.js index dc34e7f1af..0b52bbd0a6 100644 --- a/app/javascript/mastodon/reducers/compose.js +++ b/app/javascript/mastodon/reducers/compose.js @@ -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(), }); };