From c99066de9b288b00a713ee9aac98a20b3832ec56 Mon Sep 17 00:00:00 2001 From: Josh Perez <60019601+josh-signal@users.noreply.github.com> Date: Fri, 1 Oct 2021 15:27:34 -0400 Subject: [PATCH] Disallow multiline in About editing --- ts/components/ProfileEditor.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ts/components/ProfileEditor.tsx b/ts/components/ProfileEditor.tsx index b76904128..729ec118e 100644 --- a/ts/components/ProfileEditor.tsx +++ b/ts/components/ProfileEditor.tsx @@ -186,6 +186,7 @@ export const ProfileEditor = ({ } focusNode.focus(); + focusNode.setSelectionRange(focusNode.value.length, focusNode.value.length); }, [editState]); useEffect(() => { @@ -328,7 +329,7 @@ export const ProfileEditor = ({ setStagedProfile(profileData => ({ ...profileData, aboutEmoji: stagedProfile.aboutEmoji, - aboutText: value, + aboutText: value.replace(/(\r\n|\n|\r)/gm, ''), })); } else { setStagedProfile(profileData => ({