element-hq / element-x-ios

Next generation Matrix client for iOS built with SwiftUI on top of matrix-rust-sdk.
https://element.io/labs/element-x
Apache License 2.0
365 stars 75 forks source link

Selected text invisible in markdown code block #2955

Open wrjlewis opened 1 week ago

wrjlewis commented 1 week ago

Steps to reproduce

  1. Write a markdown code block with one or three back ticks
  2. Send message to the room
  3. Try to select text within the code block, you cannot see a highlighted section of test representing your selection

Outcome

What did you expect?

To be able to see which text I have selected, as you can outside of code blocks

What happened instead?

The text is still selected, but it's invisible to the user, which creates a guessing game as to whether you selected the text successfully / accurately.

On MacOS the problem is harsher because you don't have the pins at either side of the selected text. Though even on iOS, you get the pins, but not the highlighted text section between.

Your phone model

iPhone 12 pro

Operating system version

MacOS

Application version

1.6.12 (628)

Homeserver

Synapse latest

Will you send logs?

Yes

stefanceriu commented 1 week ago

Unfortunately that is an underlying UIKit fault and we need to drop down to UIKit for text messages for mention pill support.

I am able to easily reproduce the problem in a separate test app

let text = NSAttributedString(string: "Oi oi", attributes: [.font: UIFont.systemFont(ofSize: 20) , .backgroundColor: UIColor.green])
textView.attributedText = text

Screenshot 2024-06-21 at 5 31 51 PM