 
     fileprivate(set) lazy var tapGestureRecognizer: UIGestureRecognizer = {
         let recognizer = UITapGestureRecognizer(target: self, action: #selector(richTextViewWasPressed))
-        recognizer.cancelsTouchesInView = false
+        recognizer.cancelsTouchesInView = true
+        recognizer.delaysTouchesBegan = true
+        recognizer.delaysTouchesEnded = true
         recognizer.delegate = self
         return recognizer
     }()

        textView.formattingDelegate = self
        textView.mediaDelegate = self
        textView.addGestureRecognizer(self.tapGestureRecognizer)

        return textView
    }()

        } else {
            // if it's a new attachment tapped let unmark the previous one
            if let selectedAttachment = currentSelectedAttachment {
                selectedAttachment.clearAllOverlays()
                richTextView.refreshLayoutFor(attachment: selectedAttachment)
            }
            // and mark the newly tapped attachment
