Skip to content
This repository has been archived by the owner on Oct 5, 2019. It is now read-only.

pushState does not work in nested tabs #119

Closed
scriptPilot opened this issue Mar 22, 2017 · 5 comments
Closed

pushState does not work in nested tabs #119

scriptPilot opened this issue Mar 22, 2017 · 5 comments

Comments

@scriptPilot
Copy link
Contributor

scriptPilot commented Mar 22, 2017

Tested with the official kitchen sink:

  • set pushState: true
  • open kitchen sink with npm run dev
  • navigate to nested routes > tabs > third tab

Then I see no update in the URL, "tab2" remains.
Refresh the page will load tab2 instead of tab3.

bildschirmfoto 2017-03-22 um 15 35 35

@nolimits4web
Copy link
Member

And it won't at the moment because this "Tabs Routes" thing not using F7's router which doesn't support it

@bencompton
Copy link
Member

Yeah, it doesn't currently work. The problem is that only the Pages component calls router.load, which is what calls into the History API. When only a tab route changes with no page change, Pages ignores the route change event and doesn't call router.load, and therefore the tab route change doesn't affect History.

The other issue with not calling router.load on nested route changes is that view.history doesn't get updated either. When switching between tabs, using the back button to go back through the tab selection history is not usually desirable anyhow, but when switching components within a tab (which is sort of like page changes), it potentially is desirable.

I suppose the tab components could call router.load as well when a tab route changes, or perhaps the F7 Vue router could call it after all components have updated themselves after the route change event. When a link click triggers the tab change, it seems like it should default to replacing the current history item if changing to a different tab and should default to adding a new history item if changing the component displayed within a tab. It doesn't seem like that simple of a change, but maybe there is an easier way to do it.

@scriptPilot
Copy link
Contributor Author

Is it in scope to complete the routing / push state behaviour?

@bencompton
Copy link
Member

Getting History working is a pretty essential feature for the routing features in F7 Vue / React to be on par with Vue Router and React Router. It definitely belongs near the top of our priority list in the roadmap in my opinion.

@nolimits4web
Copy link
Member

Issue is closed because of outdated/irrelevant/not actual

If this issue is still actual and reproducible for latest version of Framework7 & Framework7-Vue, please create new issue and fill the issue template correctly:

  • Clearly describe the issue including steps to reproduce when it is a bug.
  • Make sure you fill in the earliest version that you know has the issue.
  • Provide live link or JSFiddle/Codepen or website with issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants