carson-katri / reddit-swiftui

A cross-platform Reddit client built in SwiftUI
MIT License
1.26k stars 87 forks source link

Blue Selection trigged when List (Blur) Selection expected #19

Open carson-katri opened 4 years ago

carson-katri commented 4 years ago

NavigationLink and List selection state seem to be overlapping.

There are two ways this happens:

    • select a post
    • see the post now has a grey selected background
    • tap section header
    • see the selected post now has a blue selected background
    • all consecutive selections will have a blue background as well
  1. Click on the edge of the list item (outside the text or images)

Perhaps make the click area fill the space so that clicking on the edge won't cause a selection.

srinikhil-07 commented 4 years ago
Screen Shot 2020-07-27 at 12 27 12 PM

@carson-katri Is this the issue you described? Seems like highlighting is stuck on first selection on the List I make and subsequent selections of topics aren't highlighted as seen.

Can you please suggest any starting point to look into this issue, I will try fixing this.

carson-katri commented 4 years ago

@Nikhil0487 I'd start in PostList.swift. There you'll see the code that handles the selection state for both NavigationLink and List. I believe the issue is that they both have selection states independent from one another, which is leading to issues with both.