DraggableCollectionView icon indicating copy to clipboard operation
DraggableCollectionView copied to clipboard

Selected cell hides selectedBackgroundView on dragging of neighbor cell

Open pronebird opened this issue 10 years ago • 3 comments

Hi,

If I don't miss anything in my implementation then I found a bug. If I select the first cell and then hold a finger on the second cell, the second cell gets selected for some time (e.g. shows my customized selectedBackgroundView), then longtap recognizer triggers and selection state gets cancelled, the first cell then loses selected state as well, but it's only a graphical defect, in fact If I start scrolling collection view the first cell repaints and becomes visually selected as before. I use simple horizontal flow layout inherited from DraggableCollectionViewFlowLayout.

pronebird avatar Jul 25 '13 17:07 pronebird

I'm not sure if I fully understand. Do you mean highlighted or selected states? Can you reproduce this in the FlowLayoutDemo? Do you need to modify the demo to reproduce? Can you give me step by step in the FlowLayoutDemo?

lukescott avatar Jul 25 '13 18:07 lukescott

I do not set a view for highlighted state, I only set selectedBackgroundView, so I see my custom selectedBackgroundView displayed when I hold a finger on cell before long tap recognizer triggers. I'll try to reproduce it in FlowLayoutDemo and give you more information on that.

pronebird avatar Jul 25 '13 18:07 pronebird

I managed to reproduce it, here is the change set to bring selectedBackgroundView to FlowLayout demo: https://github.com/pronebird/DraggableCollectionView/commit/c2ebd9a8b1f269d2540994677683f570e77fff30

Steps to reproduce:

  1. Select any cell
  2. Long tap on any neighbor cell. Previously selected cell visually lose the selection appearance, tapped view displays as selected before long tap recognizer triggers, then orange border around disappears.
  3. Unhold a tapped cell, you don't have to drag it. What we see now is that there's visually no selected cells.
  4. Scroll a bit to trigger repaint, you don't have to scroll much or bring previously selected cell off-screen, small change is enough to trigger repainting, now previously selected cell is visually selected again.

pronebird avatar Jul 25 '13 19:07 pronebird