admin4b icon indicating copy to clipboard operation
admin4b copied to clipboard

Problem with page refresh

Open visavi opened this issue 6 years ago • 5 comments

If you refresh the page from anywhere F5 or ctrl+R, it always flips up, is there any way to fix this? Chrome and firefox desktop

visavi avatar Jan 17 '20 09:01 visavi

You are right. These browsers remember the scroll position of the <body> tag. Admin4B hide the overflow content of body tag and uses .app .app-content .content-body as the body, which is causing this user experience.

marxjmoura avatar Jan 17 '20 14:01 marxjmoura

Could you try this for now?

window.onbeforeunload = function () {
  localStorage.setItem('scrollTop', $('.content-body').scrollTop());
};

$('.content-body').scrollTop(localStorage.scrollTop || 0);

marxjmoura avatar Jan 17 '20 14:01 marxjmoura

yes it works, it's just that it’s bad on js

problem html, body { height: 100%; width: 100%}

if you remove the height, then everything is fine, but the left panel does not work

visavi avatar Jan 17 '20 15:01 visavi

I know, it is not the better solution. :/

Maybe the real solution involves changing the CSS hierarchy. I will work on this in the next couple of weeks.

marxjmoura avatar Jan 17 '20 18:01 marxjmoura

Thank you, I will wait for changes

visavi avatar Jan 20 '20 11:01 visavi