From b0af4c729d5144f497ea08a5a8ce98e8f7e1bb14 Mon Sep 17 00:00:00 2001 From: kishanraja Date: Thu, 6 May 2021 21:26:58 +0530 Subject: [PATCH] Fixed auto focus issue --- .../FloatingLabelTextFieldSwiftUI/FloatingLabelTextField.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/FloatingLabelTextFieldSwiftUI/FloatingLabelTextField.swift b/Sources/FloatingLabelTextFieldSwiftUI/FloatingLabelTextField.swift index 0beed0e..5a1c7d1 100644 --- a/Sources/FloatingLabelTextFieldSwiftUI/FloatingLabelTextField.swift +++ b/Sources/FloatingLabelTextFieldSwiftUI/FloatingLabelTextField.swift @@ -59,7 +59,7 @@ public struct FloatingLabelTextField: View { var centerTextFieldView: some View { ZStack(alignment: notifier.textAlignment.getAlignment()) { - if (notifier.isAnimateOnFocus ? !isSelected : textFieldValue.isEmpty) { + if (notifier.isAnimateOnFocus ? (!isSelected && textFieldValue.isEmpty) : textFieldValue.isEmpty) { Text(placeholderText) .font(notifier.placeholderFont) .multilineTextAlignment(notifier.textAlignment)