From 8401c2612a5b3ea1a45dbdf73d25465ba8a3bf70 Mon Sep 17 00:00:00 2001 From: Doug <6060466+pixlwave@users.noreply.github.com> Date: Wed, 9 Sep 2026 13:14:12 +0100 Subject: [PATCH] Limit the custom status input to 30 characters. (#6139) --- .../SettingsScreen/View/SettingsScreenUserStatusRow.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ElementX/Sources/Screens/Settings/SettingsScreen/View/SettingsScreenUserStatusRow.swift b/ElementX/Sources/Screens/Settings/SettingsScreen/View/SettingsScreenUserStatusRow.swift index 79f86ebf9..4b62e4907 100644 --- a/ElementX/Sources/Screens/Settings/SettingsScreen/View/SettingsScreenUserStatusRow.swift +++ b/ElementX/Sources/Screens/Settings/SettingsScreen/View/SettingsScreenUserStatusRow.swift @@ -56,6 +56,11 @@ struct SettingsScreenUserStatusRow: View { .textFieldStyle(.compound(.raised)) .focused($isCustomFieldFocused) .onAppear(perform: focusCustomField) + .onChange(of: customText) { _, newValue in + if newValue.count > 30 { + customText = String(newValue.prefix(30)) + } + } .accessibilityLabel(L10n.screenSettingsUserStatusCustomHint) .padding(.vertical, 3)