SPA: Link in model to route page

I am converting my regular website into an SPA website and I’m having a blast doing it!

I have come across an interesting quirk that I am hoping someone can help me solve.

I have a group page with a button to a model pop-up to add a contact to the group. Within the model body, I have a paragraph explaining that if the contact is not listed, the user will need to add the contact first. I include a link to the contact page.

When you click on the link, it does take you to the contact page, but it has a gray overlay which does not allow you to do anything on the page until you refresh it. It appears that when you click on the link, the SPA thinks you are still in a model pop-up.

To test, do the following:

  1. Create a SPA with an index.php page with two routes attached. (One for groups and one for contacts).
  2. One the _groups.php page, create a button that opens a model. Create the model and in the default paragraph, add a link to the contacts route.
  3. Test in either preview or live mode by going to the groups page, open the model, and click on the link to contacts.

Any assistance would greatly be appreciated.

You can try adding an onclick event to your link to toggle the modal off? Does the modal actually close and leaves the background?

1 Like

Ah-Ha! Presto! That works!

Thanks @brad

1 Like

Glad that worked. I was just guessing. :wink:

1 Like