web: try setting history.scroll_restoration to manual to impove inter-page flow
This commit is contained in:
parent
f9eafff4c7
commit
3aa0144e8d
@ -50,4 +50,6 @@ features = [
|
||||
"MediaQueryList",
|
||||
"Navigator",
|
||||
"Window",
|
||||
"History",
|
||||
"ScrollRestoration",
|
||||
]
|
||||
|
||||
@ -29,6 +29,12 @@ pub fn unread_query() -> &'static str {
|
||||
pub fn init(url: Url, orders: &mut impl Orders<Msg>) -> Model {
|
||||
let version = letterbox_shared::build_version(bi);
|
||||
info!("Build Info: {}", version);
|
||||
// Disable restoring to scroll position when navigating
|
||||
window()
|
||||
.history()
|
||||
.expect("couldn't get history")
|
||||
.set_scroll_restoration(web_sys::ScrollRestoration::Manual)
|
||||
.expect("failed to set scroll restoration to manual");
|
||||
if url.hash().is_none() {
|
||||
orders.request_url(urls::search(unread_query(), 0));
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user