Giter Site home page Giter Site logo

Comments (14)

lumore avatar lumore commented on August 16, 2024 1

Can confirm.
Reproduction repo: https://github.com/lumore/momentum-modal-navigation-issue-example

from momentum-modal.

grantholle avatar grantholle commented on August 16, 2024 1

@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.

lepikhinb avatar lepikhinb commented on August 16, 2024 1

@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.

grantholle avatar grantholle commented on August 16, 2024

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.

lepikhinb avatar lepikhinb commented on August 16, 2024

IMO you should stick to 1 route = 1 modal, since that's the point of the package.

from momentum-modal.

grantholle avatar grantholle commented on August 16, 2024

Do you mean 1 route = 1 base url? Because my modals are on different routes.

from momentum-modal.

grantholle avatar grantholle commented on August 16, 2024

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.

lepikhinb avatar lepikhinb commented on August 16, 2024

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.

grantholle avatar grantholle commented on August 16, 2024

Sure, I will try recreate it

from momentum-modal.

fira03079508 avatar fira03079508 commented on August 16, 2024

I'm having a very similar issue. I have a link that go to the "forgot password" modal
image

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 :

image

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.

wPatrick avatar wPatrick commented on August 16, 2024

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.

grantholle avatar grantholle commented on August 16, 2024

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.

emargareten avatar emargareten commented on August 16, 2024

👀

from momentum-modal.

lumore avatar lumore commented on August 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.