Comments (14)
Can confirm.
Reproduction repo: https://github.com/lumore/momentum-modal-navigation-issue-example
from momentum-modal.
@lumore Not if you use an alias as mentioned in my previous comment.
I encountered an issue with Axios interceptors as discussed here, and if you correctly alias Axios, it resolves the issue.
from momentum-modal.
@lumore thanks for the clarification
@grantholle feel free to re-open the issue if the problem persists
The package has just been updated to support Inertia.js v.1.0. Make sure to update to the latest version.
from momentum-modal.
In my PUT
action, if I return Inertia::location($mySecondModalUrl)
it does load the second modal page without immediately going to the base url. Not ideal, but it achieves the functionality.
from momentum-modal.
IMO you should stick to 1 route = 1 modal, since that's the point of the package.
from momentum-modal.
Do you mean 1 route = 1 base url? Because my modals are on different routes.
from momentum-modal.
Or one modal per base route is more accurate.
My modals are on different routes, but they all share the same base url.
from momentum-modal.
Ah, I probably misread the message. I'm going to investigate the issue soon. It would help a lot if you can set up a reproduction repository.
from momentum-modal.
Sure, I will try recreate it
from momentum-modal.
I'm having a very similar issue. I have a link that go to the "forgot password" modal
If I click on the forgot password link, the route redirects to the right route. But It doesn't do anything. If I click a second time: The forgot password modal loads :
Same thing on my register modal. I have a link "Already registered?" that goes to the login modal but I have to click 2 times for it to load
from momentum-modal.
I have encountered the same problem. In my case, the "X-Inertia-Modal-*" headers were not set. So it is clearly an axios problem. After I corrected the axios version as suggested in the installation instructions, it worked.
I think this can be closed but maybe the documentation could address this clearly.
from momentum-modal.
I'm aliasing axios, so everything that needs it is using the same version.
export default defineConfig({
resolve: {
alias: {
axios: path.resolve(__dirname, 'node_modules/axios/dist/axios.js'),
}
},
//
})
from momentum-modal.
👀
from momentum-modal.
You should use the same version of axios as Inertia uses, that's written in docs. This should fix the problem.
Warning The package utilizes axios under the hood. If your app is already using axios as a dependency, make sure to lock it to the same version Inertia uses.
npm i [email protected]
from momentum-modal.
Related Issues (20)
- Cannot read properties of null (reading 'props') HOT 4
- Modal/Slide-over resets form fields HOT 1
- How to show Modal from another Modal HOT 2
- Could not resolve "@inertiajs/vue3" HOT 3
- Possible to pass a URL to redirect function? HOT 1
- baseRoute component rerender every time
- Any example on how to use it with Svelte?
- Header X-Inertia-Modal-Redirect - CORS issue
- Call to a member function with() on null HOT 1
- Cannot read properties of null (reading 'props') HOT 1
- [Question] Possible to prevent reloading if already open?
- TypeScript typings HOT 1
- Problem with Inertia forms HOT 1
- Need to @click='close' when using links inside modals? HOT 4
- Modal 404s When Accessing Again
- Demo page incorrect password
- Refresh the baseRoute page data HOT 2
- Base Component resets state when opening the modal
- Please support inertia-laravel v1.0
- How to use preserve state on close correctly? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from momentum-modal.