Searching removes the backgroundColor of DecodingError highlighted text.
wynioux opened this issue · comments
Bahadır A. Güder commented
I have provided screenshots below.
- Default
- Searching part of DecodingError highlighted text
- As you can see, the backgroundColor has been removed
I think this piece of code is causing the bug (it can be found in RichTextViewModel.clearMatches()
), but it should be investigated.
textStorage.removeAttribute(.backgroundColor, range: range)
Potential Fix:
We can store the original backgroundColor in RichTextViewModel.SearchMatch
and restore the color just like foregroundColor.
Bahadır A. Güder commented
By the way I forgot to mention I tested it with code in Main Branch (4.0.0-beta.4) and iOS 16.4.
Alex Grebenyuk commented
Good catch.
We can store the original backgroundColor in RichTextViewModel.SearchMatch and restore the color just like foregroundColor.
It seems like an optimal solution.
Alex Grebenyuk commented
Fixed in #210