Skip to content

Commit 4331f52

Browse files
committed
Mitigate the unclipped text bug
1 parent 62f187b commit 4331f52

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Sources/ResizingTextView/TextView (UIKit).swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ struct TextView: UIViewRepresentable {
4848
view.setContentHuggingPriority(.defaultHigh, for: .vertical)
4949
view.textContainer.lineFragmentPadding = 0
5050
view.backgroundColor = .clear
51-
view.clipsToBounds = false
5251
view.delegate = context.coordinator
5352
return view
5453
}
@@ -57,6 +56,7 @@ struct TextView: UIViewRepresentable {
5756
var needsInvalidateIntrinsicContentSize = false
5857

5958
view.hasDynamicHeight = !isScrollable
59+
view.clipsToBounds = isScrollable
6060

6161
if view.text != text {
6262
view.text = text

0 commit comments

Comments
 (0)