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

Though defaultMultipleSelection is true still multiple selection is not enabled #524

Closed
saurabhbajajcode opened this issue Jul 12, 2020 · 4 comments

Comments

@saurabhbajajcode
Copy link

Describe the bug
When we set YPImagePickerConfiguration().library.defaultMultipleSelection = true still multiple selection is not enabled by default.

To Reproduce
Steps to reproduce the behavior:

  1. Create YPImagePicker object. You can use following code:
@IBAction func uploadImageTapped(_ sender: Any) {
        var config = YPImagePickerConfiguration()
        config.library.mediaType = .photo
        config.showsPhotoFilters = false
        config.shouldSaveNewPicturesToAlbum = false
        config.startOnScreen = .library
        config.screens = [.library, .photo]
        config.showsCrop = .none
        config.wordings.libraryTitle = "Gallery"
        config.hidesStatusBar = false
        config.hidesBottomBar = false
        config.maxCameraZoomFactor = 2.0
        config.library.maxNumberOfItems = allowedMaxTotalImages
        config.gallery.hidesRemoveButton = false
        config.library.preselectedItems = selectedYPMediaItems
        config.library.skipSelectionsGallery = true
        config.library.defaultMultipleSelection = true

        let picker = YPImagePicker(configuration: config)
        picker.didFinishPicking { [unowned picker] items, cancelled in
            if cancelled {
                picker.dismiss(animated: true, completion: nil)
                return
            }
            self.selectedYPMediaItems = items
            self.removeAllButton.isHidden = self.selectedYPMediaItems.isEmpty
            self.setNextButtonTitleForImageViewScreen()
            picker.dismiss(animated: true, completion: nil)
        }
        present(picker, animated: true, completion: nil)
 }
  1. Call above function on tap of a button
  2. Select only 1 image. Tap Next.
  3. Again open image picker.
  4. When image picker is displayed you will observe that multiple selection is not enabled even though defaultMultipleSelection was set as true. Also, the previous selected image is not highlighted.
    Refer attached gif.

Expected behavior
When defaultMultipleSelection is set as true then multiple selection should get enabled irrespective of number of items previously selected.

Screenshots
This screenshot and gif is after setting defaultMultipleSelection as true.

Screenshot 2020-07-13 at 12 17 23 AM

YPImagePicker_Default_Multiple_Selection_Issue

Environment (please complete the following information):

  • Device: Any device
  • OS: Any OS
  • Xcode Version Any version
  • Swift Version Any version

Installation Type

  • Cocoapods: I have tried only with CocoaPods.

Additional context
I am using release 4.2.0

saurabhbajajcode pushed a commit to saurabhbajajcode/YPImagePicker that referenced this issue Jul 12, 2020
- if defaultMultipleSelection is true then enable multiple selection irrespective of number of selected items

- Github Issue: Yummypets#524

Reported-by: Saurabh Bajaj <[email protected]>
Signed-off-by: Saurabh Bajaj <[email protected]>
@saurabhbajajcode
Copy link
Author

I do not have access to link PR #525 with this issue.

@s4cha
Copy link
Member

s4cha commented Aug 4, 2020

Hi @saurabhbajajcode,
Thank you so much for noticing that, documenting it thoroughly with video gif (amazing!) and issuing a clean PR that fixes it.
This is really splendid !

@heitara
Copy link
Contributor

heitara commented Aug 5, 2020

@s4cha shall we close this, once it's already merged?

@s4cha
Copy link
Member

s4cha commented Aug 6, 2020

Yep, this should be fixed as of 4.3.0 and coming 4.3.1 :)

@s4cha s4cha closed this as completed Aug 6, 2020
LucasDang pushed a commit to pukapp/secret-ios-YPImagePicker that referenced this issue Feb 10, 2022
- if defaultMultipleSelection is true then enable multiple selection irrespective of number of selected items

- Github Issue: Yummypets#524

Reported-by: Saurabh Bajaj <[email protected]>
Signed-off-by: Saurabh Bajaj <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants