eakoriakin / ionic-selectable

Ionic Selectable is an Ionic versatile and highly customizable component that serves as a replacement to Ionic Select, and allows to search items, including async search, create items, customize the layout with templates and much more. It provides an intuitive API and is easy to set up and use.
MIT License
550 stars 126 forks source link

onClose not firing when the inner modal is directly dismissed with ModalController #319

Closed Artaud closed 3 years ago

Artaud commented 3 years ago

Description: When using Ionic ModalController.getTop() to be able to generically dismiss any ion-modal that is currently on the screen, IonicSelectable will not fire onClose() event when the modal is dismissed by calling dismiss().

this.modalCtrl.getTop()
  .then(modal => {
    if (modal) {
      modal.dismiss()
    }
})

Use case: I'm using it for a canDeactivate guard in Angular, so that I can bind the browser/mobile back button to dismissing any modal that is currently on the screen.

Please let me know what you think about that, I'm open to do a PR after some discussion.

edy-ap commented 3 years ago

Is a great feature, which is currently not implemented.

If you can send a PR, it would be great.