Post

Replies

Boosts

Views

Activity

Reply to NavigationLink selected state area is larger than the underlying view
A hacky workaround I found for having a hover state, a fill, and a select state that don't conflict - pass the $selectedCase all the way down to Case Row and then use it as a condition to apply my .rowBackground() styling. So the styling only gets applied to the items that are not selected. It prevents a grey box inside the blue select box. It's not perfect because the $selectedCase only gets updated on full click, so when you just click (without releasing just yet), the previously selected case gets no container at all and the case you're about to select has the grey container inside blue selected one. But it's pretty fast so not as much of an issue. I tried things like .simultaneousGesture(TapGesture().onEnded { ... } to pass a hover state to the CaseRow to remove / apply the styling on mouse down instead of full click but couldn't figure it out. If someone knows a way to modify the native selected state or evolve this solution with the mouse down logic, would appreciate your help.
Apr ’23