-
Notifications
You must be signed in to change notification settings - Fork 8
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
Pages don't reload when redirecting out of modals #47
Comments
Thanks for the kind words! It's awesome to hear you've been enjoying the new framework. The modal is dismissed because a new page is requested. If that new page does not have Any time Hotwire Native loads a new page it first checks to see if the current page matches the URL of the new one exactly. If so, it will replace said page, which looks like it is reloading it when being dismissed from a modal. My guess is that sometimes you are redirecting to a new page after signing in and sometimes you are redirecting back to the original non-modal page. Feel free to post more of the Rails code, if possible, and I can help debug. |
Hi! Maybe I should clarify the problem a little better
I'm super happy to share whatever code would be helpful. Thank you so much for your time! |
I've temporarily turned the modal presentation off in our paths and, without it, everything works totally fine. |
Interesting! Can you enable logging and share what shows up when you trigger the flow? |
Hi team, first of all congrats on launching v1.0. It's really been a pleasure migrating from the old package. I noticed a small bug I haven't been able to resolve yet in our app that I thought I'd raise an issue about since if might affect others. In our paths, I put something like:
This works quite well to put out sign-in and sign-up pages (which are managed through
devise
) in a modal. The interface of that feels a bit more "native-ish" than if these pages are just loaded in the inline stack. And it does work sometimes.But frequently, I get an issue where, after successfully signing in, hotwire-native closes the modal totally fine. But if the sign in redirects back to the page that was open underneath the modal, that page doesn't always refresh. Sometimes it does, so I'm a bit confused since the behavior isn't consistent. But it often doesn't.
I'm not 100% sure whether it's a framework error or just me being a more experienced Rails dev than a Swift one. But my instinct is that, if a modal triggers a redirect to a page that's already open under the modal context, that page should always get reloaded, no?
Thanks so much for your help and awesome work on this project!
The text was updated successfully, but these errors were encountered: