Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Ability to choose more assets than allowed to (maxAssets) #115

Closed
yanivshaked opened this issue May 2, 2021 · 7 comments
Closed
Labels
s: bug Something isn't working. ⏳TOMORROW This issue is scheduled to be solved within two days.

Comments

@yanivshaked
Copy link
Contributor

Bug description
Ability to choose more items than the picker was allowed to (maxAssets).

How to reproduce

  • Run the example
  • Click Single Asset picker page
  • Click WeChat moment (or any other option that is NOT no preview)
  • Click on an image to get its preview
  • Select it using the "Select" button at the bottom bar
  • Swipe right to get to the next image
  • Select it
  • Keep doing so until you select 10 images
  • Click the back button
  • You have 10 images selected (when 9 is the maximal number)

Expected behavior
Should not allow selection of more than maxAssets

Screenshots
For example, I selected 12 assets:
Screenshot

Device information

  • Device: Android OnePlus 8T
  • OS: Android 10
  • Package Version: 5.2.1
  • Flutter Version: 2.0.5

Additional context
Let me know what are your thoughts on solving this, I can submit a PR.

@yanivshaked yanivshaked added the await investigate The issue is waiting for further investigation. label May 2, 2021
@github-actions github-actions bot added the await triage The issue is waiting for triage. label May 2, 2021
@AlexV525
Copy link
Member

AlexV525 commented May 2, 2021

Is this reproducible in other methods?

@yanivshaked
Copy link
Contributor Author

Reproducible whenever the preview is displayed. Select 9 assets, preview an asset which was not selected and select it => You have 10 assets selected.

@AlexV525
Copy link
Member

AlexV525 commented May 2, 2021

Then we should add a count check at here maybe.

@yanivshaked
Copy link
Contributor Author

This also requires transferring maxAssets to AssetPickerViewer.pushToViewer, agree?

@yanivshaked
Copy link
Contributor Author

Another option, is to use the selectorProvider for selection (so the validation is done in one place), but it is not always transferred to the AssetPickerViewerBuilderDelegate.

@AlexV525
Copy link
Member

AlexV525 commented May 2, 2021

This also requires transferring maxAssets to AssetPickerViewer.pushToViewer, agree?

This sounds more reasonable.

@AlexV525 AlexV525 added s: bug Something isn't working. ⏳TOMORROW This issue is scheduled to be solved within two days. and removed await investigate The issue is waiting for further investigation. await triage The issue is waiting for triage. labels May 3, 2021
@yanivshaked
Copy link
Contributor Author

Merge is done, I'm closing this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s: bug Something isn't working. ⏳TOMORROW This issue is scheduled to be solved within two days.
Projects
None yet
Development

No branches or pull requests

2 participants