How to refresh a page with Turbolinks

前端 未结 3 542
感动是毒
感动是毒 2021-02-07 09:09

I understand that I can call the following code on Turbolinks 5 but it changes the scroll position. Is there a way to call Turbolinks to refresh the page and not change the scro

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-07 09:53

    It's bene a while, not sure if you would still need a solution. You can try this, which disable/enable scrolling before and after loading page content:

    Turbolinks.enableTransitionCache(true);
    Turbolinks.visit(location.toString());
    Turbolinks.enableTransitionCache(false);
    

提交回复
热议问题