From bc775a509cc97a900d100515b05c96294954e02c Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Tue, 26 May 2026 09:14:39 +0200 Subject: [PATCH] Stop message bubbles from stealing dropped files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Each bubble's UITextView keeps `isSelectable = true` so links remain tappable, which also makes it a valid drop target — items dragged onto a bubble landed on the text view instead of bubbling up to the timeline's `.onDrop`. Disable `textDropInteraction` alongside the existing `textDragInteraction` workaround. --- ElementX/Sources/Other/Pills/MessageText.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ElementX/Sources/Other/Pills/MessageText.swift b/ElementX/Sources/Other/Pills/MessageText.swift index 845e13256..3cf861984 100644 --- a/ElementX/Sources/Other/Pills/MessageText.swift +++ b/ElementX/Sources/Other/Pills/MessageText.swift @@ -173,6 +173,11 @@ struct MessageText: UIViewRepresentable { // Otherwise links can be dragged and dropped when long pressed textView.textDragInteraction?.isEnabled = false + // Otherwise items dropped onto a bubble land on the text view instead of + // bubbling up to the timeline's drop handler. + if let textDropInteraction = textView.textDropInteraction { + textView.removeInteraction(textDropInteraction) + } textView.contentInset = .zero textView.contentInsetAdjustmentBehavior = .never