Skip to content

Commit

Permalink
Used IsSnapshotTestingKey in TextField to make the cursor invisible d…
Browse files Browse the repository at this point in the history
…uring snapshot tests.
  • Loading branch information
sjavora committed Apr 11, 2024
1 parent 4887a85 commit 7f8b6dd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/Orbit/Support/TextFields/TextField.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public struct TextField: UIViewRepresentable, TextFieldBuildable {
@Environment(\.textFontWeight) private var textFontWeight
@Environment(\.textColor) private var textColor
@Environment(\.textSize) private var textSize
@Environment(\.isSnapshotTesting) private var isSnapshotTesting

@Binding private var value: String
private var prompt: String
Expand All @@ -52,7 +53,7 @@ public struct TextField: UIViewRepresentable, TextFieldBuildable {

textField.clearsOnBeginEditing = false
textField.adjustsFontForContentSizeCategory = false
textField.tintColor = .blueNormal
textField.tintColor = context.environment.isSnapshotTesting ? .clear : .blueNormal

textField.setContentHuggingPriority(.defaultHigh, for: .vertical)
textField.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
Expand Down

0 comments on commit 7f8b6dd

Please sign in to comment.