From 3b31f36a03383579482bbe69eb03a985bbe7e6be Mon Sep 17 00:00:00 2001 From: Angelo Stavrow Date: Wed, 11 Nov 2020 10:36:32 -0500 Subject: [PATCH] Fix bug with placeholder text not disappearing --- iOS/PostEditor/PostBodyTextView.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/iOS/PostEditor/PostBodyTextView.swift b/iOS/PostEditor/PostBodyTextView.swift index e123c8d..3ab791e 100644 --- a/iOS/PostEditor/PostBodyTextView.swift +++ b/iOS/PostEditor/PostBodyTextView.swift @@ -23,12 +23,17 @@ class PostBodyCoordinator: NSObject, UITextViewDelegate, NSLayoutManagerDelegate self.lineSpacingMultiplier = lineSpacingMultiplier } + func textViewDidChange(_ textView: UITextView) { + DispatchQueue.main.async { + self.postBodyTextView.text = textView.text ?? "" + } + } + func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool { return true } func textViewDidEndEditing(_ textView: UITextView) { - self.postBodyTextView.text = textView.text ?? "" self.isFirstResponder = false self.didBecomeFirstResponder = false }