John
May 27, 2020, 9:29am
1
Hi,
I am using calendar, smart select inside a view with pushstate: true.
The url will become #!/myView/calendar/ from #!/myView/ when the calendar is opened.
The calendar closes when browser “history.back”.
However, if user “history.forward” now, my page will turn to 404 not found.
I am thinking if this behaviour comes from the same problem like what I posted - Detail Routes’s pushstate link won’t work if master route has params?
I want my view has pushstate but not the popups (calendar, etc). Is there a way to disable the calendar’s pushstate?
I have tried some approaches but don’t work, such as
in app init options - calendar:{ pushState: false}
in calendar.create option
Thanks.
They have parameter routableModals
which is enabled by default, disable it and they don’t push state
1 Like
John
May 28, 2020, 3:14am
3
Yes, this disables pushState.
But, now the pushState is important because the modal is kept on the screen when “history.back” to the previous view.
John
May 28, 2020, 6:01am
4
I am using this workaround to auto-close the modals when user navigates away,
window.addEventListener('popstate', function() {
["calendar","popup","popover"]
.forEach( (name)=>{
try {
app[name].get().close();
} catch (e) {}
});
});
In my case, i’v solve it adding this to the selects, popups…
data-close-on-select=“true” data-routable-modals=“false”
the data-routable-modals=“false” do the trick…
hope it helps and sorry for my english