Skip to content

Commit

Permalink
Merge pull request #11 from maail/patch-1
Browse files Browse the repository at this point in the history
[FIX] Fix crash when isEditing is true
  • Loading branch information
kenmueller authored Apr 11, 2020
2 parents 41eb93b + 5149081 commit 2a5118f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Sources/TextView/TextView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,11 @@ public struct TextView: View {
textView.isScrollEnabled = isScrollingEnabled
textView.isUserInteractionEnabled = isUserInteractionEnabled

_ = isEditing
? textView.becomeFirstResponder()
: textView.resignFirstResponder()
DispatchQueue.main.async {
_ = isEditing
? textView.becomeFirstResponder()
: textView.resignFirstResponder()
}
}
}

Expand Down Expand Up @@ -220,9 +222,7 @@ public struct TextView: View {
height: geometry.size.height,
alignment: self.placeholderAlignment
)
.onTapGesture {
self.isEditing = true
}
.allowsHitTesting(false)
}
}
}
Expand Down

0 comments on commit 2a5118f

Please sign in to comment.