momentum-modal
momentum-modal copied to clipboard
Feature request: remove modal from browsing history on closing
Hi!
My use case: I use this modal feature to view a dish on a menu in order to select associated toppings. The problem is that when somebody has viewed 10 dishes sequentially and goes back with the back button, all the modals reappear in the same order from history.
Seems logical considering how InertiaJS is put together, but perhaps it would be a nice addition to provide the ability to disable this behaviour for modals if desired.
This is a necessity in my opinion. Modals should not appear in the browser history at all. Would this be possible by using the replace
option in redirect
?
I just saw that a PR has been submitted at Inertia itself that has a preserveUrl
-property. Maybe this is also a solution for this case?
See https://github.com/inertiajs/inertia/pull/1259
Has this been implemented already? My modal is not stored in history at all.
@jeffreyvanhees, that's how the package and Inertia.js work since we treat modals as pages. But I'll take that into account
@lepikhinb, @iamniels I've submitted a PR that allows changing the options for Inertia's visit()
function called by the redirect()
function to enable this. See https://github.com/lepikhinb/momentum-modal-plugin/pull/11