framework7 icon indicating copy to clipboard operation
framework7 copied to clipboard

domCache breaks navigation

Open tinyCoder32 opened this issue 9 years ago • 9 comments

Hi, I have previously reported an issue about this that is solved for me by making domCache: false, but now I found that i need it to be true.

The problem in short is after going deep in navigation to the third page in the IOS style, then going back to page one, the page one navbar gets hidden, and there is a class on it called "cached".

Any help please?

tinyCoder32 avatar Feb 06 '17 10:02 tinyCoder32

Please, any fix for this. It is driving me crazy :(

tinyCoder32 avatar Feb 18 '17 16:02 tinyCoder32

Here are more details:

I have a normal iOS example that consists of an index page (LEVEL 1), it has some links I use to open other pages (LEVEL 2).

var mainView = myApp.addView('.view-main', {
	dynamicNavbar: true,
	domCache: true
});

In those Level 2 pages, I have a button that opens a photo browser:

$$('.ad-popup, .ad-images img').on('click', function() {
		var photos = [];
		$$(".ad-images .swiper-slide img").each(function() {
			photos.push($$(this).data('full'));
		});
		var photoBrowser = myApp.photoBrowser({
			photos: photos,
			lazyLoading: true,
			loop: true,
			type: 'page',
			backLinkText: _t('Close'),
                        ofText: _t('of'),
		});
		photoBrowser.open();
	});

After clicking, a LEVEL 3 page will show up with the photo slider, for now everything is normal. If I click back to page LEVEL 2, everything is normal also, but when I get back to the Index page, the navbar get disappear! when I try to inspect the navbar element, I see the strange thing is that navbar-inner has a new class called navbar-inner navbar-on-left cached and the center class has another sliding class which is stuck there with a style element style="left: 0px; transform: translate3d(-122.5px, 0px, 0px);" ... looks like the JavaScript sliding method get stuck and never continues the animation!

Here is a GIF video describing the issue again! (4 MB)

untitled

I appreciate your kind help, because it's driving me crazy.

tinyCoder32 avatar Feb 26 '17 08:02 tinyCoder32

I can 100% confirm that this is caused when a Level 3 page is opened in my app.

tinyCoder32 avatar Feb 28 '17 20:02 tinyCoder32

https://github.com/nolimits4web/Framework7/issues/1267

this conversation should help you to understand the "current" misleading usecase of domcache

Dawandevo avatar Feb 28 '17 20:02 Dawandevo

The problem is that the level 1 (index) page has dynamically generated content, if I disabled domCache and went to a level 3 page, then get back to index, the page will be empty and I will have to re-generate the content again (which is bad in my case).

tinyCoder32 avatar Feb 28 '17 21:02 tinyCoder32

@tinyCoder32 there is something wrong with your layout or in scripts, will be really helpful to see some live app or at least JSFiddle/Codepen with the reproducable issue

nolimits4web avatar Mar 06 '17 21:03 nolimits4web

@nolimits4web , took me 2 hours to reproduce the issue, luckily I was able to identify the problem source, which is the search bar! when I remove it from the navbar, the problem don't show up, but if I keep it there, then going back from a 3rd level page will cause the navbar to get hidden.

Please refer to: https://jsfiddle.net/tinyCoder32/4nh106he/

Please note that in my case I would like to show that search form on all my inline pages. I appreciate looking into this issue and providing a solution, thank you.

tinyCoder32 avatar Mar 06 '17 23:03 tinyCoder32

Move out searchbar from navbar. Put it in navbar-inner or if you need it everywhere move it outside of navbar and put it as the direct child of "pages"

nolimits4web avatar Mar 17 '17 10:03 nolimits4web

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Jun 25 '18 06:06 lock[bot]