question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Open a 2nd Modal and then close the 1st modal

See original GitHub issue

Hi,

@ionic/angular": "4.11.5"

I have a series of Modal items. All are working fine. But the only issue here is how to close the current modal after 2nd modal has been opened.

I have tried this. But then it never opens the 2nd Modal.

This is within the 1st Modal

async next(): Promise<void> { // try to open 2nd Modal and after that close the 1st Modal

  await this.showSeeAgainModal();
  this.cancel();

  }

  cancel(): void {
    this.modalController.dismiss();
  }



async showSeeAgainModal(): Promise<void> { // This is the 2nd Modal
    const modal: HTMLIonModalElement = await this.modalController.create({
      component: SeeAgainPage,
    });

    modal.onDidDismiss().then(async (res) => {
    });

    return await modal.present();
  }

I can use simply like so:

But the problem here is it closes the 1st Modal before open the 2nd one. It gives bad UX.

next(): Promise<void> { // this is working fine. But bad UX

      this.showSeeAgainModal();
      this.cancel();

      }

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Sampath-Lokugecommented, Apr 3, 2020

After I have talked to my client I changed it to a series of pages. i.e. not using series fo Modals. So now I don’t need this feature. Thanks @liamdebeasi

1reaction
indraraj26commented, Jan 22, 2020

This would be great if ionic team can implement this which will hide first modal behind the scene.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bootstrap modal: close current, open new - Stack Overflow
When an user pushes a button inside this modal, I want the current modal to hide, and immediately after that, I want a...
Read more >
Bootstrap : Close current and open a new modal window
Bootstrap : Close current and open a new modal window. This is very basic requirement to open second modal window by clicking on...
Read more >
Modal over another modal - Material Design for Bootstrap
Hi,. I need your help, I want to display a modal over another one but the overlay(mask/backgraund) don't apply over the first one....
Read more >
Modal · Bootstrap v5.0
Modals are built with HTML, CSS, and JavaScript. · Clicking on the modal “backdrop” will automatically close the modal. · Bootstrap only supports...
Read more >
If multiple modals, scroll lock fails to clear after closing last ...
While in the first modal, user activates a second modal, which closes the first and opens the second; disableBodyScroll() adds a scroll lock...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found