fix: disable drag and link preview for text editor in compose scene
This commit is contained in:
parent
71cb19ccae
commit
66643e1058
|
@ -767,6 +767,22 @@ extension ComposeViewController: UITextViewDelegate {
|
|||
return autoCompleteInfo
|
||||
}
|
||||
|
||||
func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool {
|
||||
if textView === textEditorView()?.textView {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
func textView(_ textView: UITextView, shouldInteractWith textAttachment: NSTextAttachment, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool {
|
||||
if textView === textEditorView()?.textView {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// MARK: - TextEditorViewTextAttributesDelegate
|
||||
|
|
|
@ -27,6 +27,7 @@ final class ComposeStatusContentTableViewCell: UITableViewCell {
|
|||
metaText.textView.backgroundColor = .clear
|
||||
metaText.textView.isScrollEnabled = false
|
||||
metaText.textView.keyboardType = .twitter
|
||||
metaText.textView.textDragInteraction?.isEnabled = false // disable drag for link and attachment
|
||||
metaText.textView.textContainer.lineFragmentPadding = 10 // leading inset
|
||||
metaText.textView.font = UIFontMetrics(forTextStyle: .body).scaledFont(for: .systemFont(ofSize: 17, weight: .regular))
|
||||
metaText.textView.attributedPlaceholder = {
|
||||
|
|
Loading…
Reference in New Issue