Skip to content

Commit

Permalink
Fixes #2924 - Allow timeline messages text selection on both the Mac …
Browse files Browse the repository at this point in the history
…and on iOS (not on long press but a double tap)

- remove double tap to show the emoji picker as it clashes with the selection and was introduced before the rich timeline item menu was introduced
  • Loading branch information
stefanceriu committed Jun 14, 2024
1 parent 63a474b commit 2dccfff
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 8 deletions.
5 changes: 0 additions & 5 deletions ElementX/Sources/Other/Pills/MessageText.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ struct MessageText: UIViewRepresentable {
textView.adjustsFontForContentSizeCategory = true

// Required to allow tapping links
// We disable selection at delegate level
textView.isSelectable = true
textView.isUserInteractionEnabled = true

Expand Down Expand Up @@ -135,10 +134,6 @@ struct MessageText: UIViewRepresentable {
self.openURLAction = openURLAction
}

func textViewDidChangeSelection(_ textView: UITextView) {
textView.selectedTextRange = nil
}

func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool {
switch interaction {
case .invokeDefaultAction:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,6 @@ struct TimelineItemBubbledStylerView<Content: View>: View {

var messageBubble: some View {
styledContent
.onTapGesture(count: 2) {
context.send(viewAction: .displayEmojiPicker(itemID: timelineItem.id))
}
.onTapGesture {
context.send(viewAction: .itemTapped(itemID: timelineItem.id))
}
Expand Down
1 change: 1 addition & 0 deletions changelog.d/2924.change
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Allow timeline messages text selection on both the Mac and on iOS (not on long press but a double tap)

0 comments on commit 2dccfff

Please sign in to comment.