fix an issue when input showing error message the layout would change

This commit is contained in:
ryanzhao 2023-08-23 15:15:33 +10:00
parent f6bf61f1b3
commit f5e086dee1
1 changed files with 11 additions and 5 deletions

View File

@ -56,11 +56,17 @@ public struct SessionTextField: View {
.stroke(themeColor: (error?.isEmpty == false) ? .danger : .borderSeparator) .stroke(themeColor: (error?.isEmpty == false) ? .danger : .borderSeparator)
) )
Text(error ?? " ") ZStack {
.bold() Text(error ?? "")
.font(.system(size: Values.mediumFontSize)) .bold()
.foregroundColor(themeColor: .danger) .font(.system(size: Values.mediumFontSize))
.multilineTextAlignment(.center) .foregroundColor(themeColor: .danger)
.multilineTextAlignment(.center)
}
.frame(
height: 50,
alignment: .top
)
} }
} }
} }