From f5e086dee10204f520523a7143ad0d3bdd7861d6 Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Wed, 23 Aug 2023 15:15:33 +1000 Subject: [PATCH] fix an issue when input showing error message the layout would change --- SessionUIKit/Components/SessionTextField.swift | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/SessionUIKit/Components/SessionTextField.swift b/SessionUIKit/Components/SessionTextField.swift index a688ec9bb..0795ef914 100644 --- a/SessionUIKit/Components/SessionTextField.swift +++ b/SessionUIKit/Components/SessionTextField.swift @@ -56,11 +56,17 @@ public struct SessionTextField: View { .stroke(themeColor: (error?.isEmpty == false) ? .danger : .borderSeparator) ) - Text(error ?? " ") - .bold() - .font(.system(size: Values.mediumFontSize)) - .foregroundColor(themeColor: .danger) - .multilineTextAlignment(.center) + ZStack { + Text(error ?? "") + .bold() + .font(.system(size: Values.mediumFontSize)) + .foregroundColor(themeColor: .danger) + .multilineTextAlignment(.center) + } + .frame( + height: 50, + alignment: .top + ) } } }