Skip to content

Commit b0af4c7

Browse files
committed
Fixed auto focus issue
1 parent 9c8ab96 commit b0af4c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/FloatingLabelTextFieldSwiftUI/FloatingLabelTextField.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public struct FloatingLabelTextField: View {
5959
var centerTextFieldView: some View {
6060
ZStack(alignment: notifier.textAlignment.getAlignment()) {
6161

62-
if (notifier.isAnimateOnFocus ? !isSelected : textFieldValue.isEmpty) {
62+
if (notifier.isAnimateOnFocus ? (!isSelected && textFieldValue.isEmpty) : textFieldValue.isEmpty) {
6363
Text(placeholderText)
6464
.font(notifier.placeholderFont)
6565
.multilineTextAlignment(notifier.textAlignment)

0 commit comments

Comments
 (0)