Skip to content

Commit 4b98a2a

Browse files
recalculate text input height when device rotates
1 parent e42e06e commit 4b98a2a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Sources/ComponentsKit/Components/TextInput/SUTextInput.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,13 @@ public struct SUTextInput<FocusValue: Hashable>: View {
112112
)
113113
}
114114
}
115+
.onChange(of: geometry.size.width) { newValue in
116+
self.textEditorPreferredHeight = TextInputHeightCalculator.preferredHeight(
117+
for: self.text,
118+
model: self.model,
119+
width: newValue
120+
)
121+
}
115122
}
116123
)
117124
.clipShape(

0 commit comments

Comments
 (0)