hcbpassos / drag_select_grid_view

A grid that supports both dragging and tapping to select its items.
BSD 2-Clause "Simplified" License
133 stars 34 forks source link

swipe back on iOS and onTap to select #23

Closed gbbest15 closed 3 years ago

gbbest15 commented 3 years ago
  1. here i have two issue with the plugin, immediately i apply the plugin the swipe back to the previous page did not work on the page
  2. my onTap to select is not working until i long press any first item before the ontap to select will start working
hcbpassos commented 3 years ago

here i have two issue with the plugin, immediately i apply the plugin the swipe back to the previous page did not work on the page.

This happens because, internally, we're using WillPopScope. This widget prevents swipe back from working. To fix that, we must instead add an entry to the local history.

my onTap to select is not working until i long press any first item before the ontap to select will start working

I'm not sure I understand what you mean. Would you mind further elaborating? Maybe an example can help.

gbbest15 commented 3 years ago

This happens because, internally, we're using WillPopScope. This widget prevents swipe back from working. To fix that, we must instead add an entry to the local history.

can you explain how to fix this....

  1. so let me explain better, if i first ontap any item in the view, the select is not working. so i long press any one item in the view then the select start working with the rest item with the ontap..

so let assume i have 5 itmes in the view, so i ontap item 1 to change the bgcolor to identify that is selected, the ontap will not work meaning it will not select, even if i select item 3 or 2 or 4, it will not select. until i long press any item from 1-5 then the bgcolor of the item i selected will change then the ontap for rest item will start working,

that means after the first long press the ontop to select will start working

hcbpassos commented 3 years ago

can you explain how to fix this....

Don't worry about it, I'll sort it out soon ;)

if i first ontap any item in the view, the select is not working. so i long press any one item in the view then the select start working with the rest item with the ontap..

That's the intended behavior. The reason is I must give the library user the opportunity to handle the regular tap. Imagine this library is used in a gallery app, just like Google Photos. When the user taps a photo, it must show the picture in another screen. If we were to start the selection without long-press, this would not be possible.

Your request is valid, though. In fact, there's a PR to add a flag so it's possible to start selection without long-press. Check https://github.com/hcbpassos/drag_select_grid_view/pull/18 out.

gbbest15 commented 3 years ago

thanks so much. please as soon you made changes let me know, so that i can give my boss date to fix it...

hcbpassos commented 3 years ago

Fixed by 3a995c9122e4db5ce35276300f1908cdba72c4bb. Available on release 0.5.0.