Modal behaviour

The ‘Open Modal’ action opens further pages in the Modal itself, rather than in the main window. Eg. if I use modal to open the Sign In box/page on my website, the customer portal post-login opens inside the same modal. How I expect it to behave is that, after signing in inside the modal, the modal should go away and redirection to the signed-in customer portal should happen in the main window.

Not sure if this is indeed the intended behaviour, but in its current state, the modal action seems useful only to display popup tooltips etc.

@s.matah are those links from softr app or from external pages ?

Softr app.

I made the sign-in page & Customer dashboard page in 1 app on Softr. When I open the sign-in page using the new ‘Open Modal’ action and sign in, the dashboard opens within that same modal.

How I expect it to work is exactly how Login on this forum (community.softr.io) works.

I know it’s been a while, but did you ever figure this out @s.matah ?

It has been a few weeks since I last tried it, but I haven’t seen any updates addressing this, so I believe the behaviour is still the same as described above.

We are having the same error. It’s not a good UX. It sends the user to our homepage in the Modal after they sign in. Worse still, if they close the modal, they’re not logged in.

Our current work around is to have TWO sign-in pages: one that is just for Modals and gives the user the instructions to close the popup and refresh the page they were on…

Any chance to have a fix?

@artur @Suzie

This is a very bad UX :frowning: Hope it will be fixed soon!

OR it could be fixed with dynamic option to input URL instead of choosing a page to be redirected!

Is there an update on this? Receiving a number of user complaints.

Hi,
Something to consider, meanwhile:

I may be able to adapt the code to force an automated page reload, if so, this would suit you?

2 Likes

YES! an automated page reload would be great, as my sign up is within a modal!

Hi Brian

Here would be the code.
useraccounts1 is the id/name of the signup block. Change it by yours. Also, this code is set to do a history back (1 page back before the signup modal was opened) in the parent page (and as a consequence will close automatically the modal)

<script>
  window.addEventListener('submit-form-success-useraccounts1', () => {
    const currentPageUrl = window.location.href;

    _setCookie('signInUpRedirectionUrl', encodeURIComponent(currentPageUrl), 1);

    setTimeout(() => {
      window.parent.history.go(-1);
    }, 100);

    function _setCookie(name, value, days) {
      var date = new Date();
      date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
      var expires = "expires=" + date.toUTCString();
      document.cookie = name + "=" + value + ";" + expires + ";path=/;" + 'SameSite=Lax; Secure';
    }
  });
</script>

If you need a simple parent page reload:

<script>
window.addEventListener('block-loaded-user-accounts1', () => {
  window.addEventListener('submit-form-success-useraccounts1', () => {
    setTimeout(() => {
      window.parent.location.reload();
    }, 100);
  });
});
</script>