Describe the problem
Context here: #16449 (comment). Please no PRs for this until that one is merged.
Basically, goto(url, { keepFocus: true }) is a lie. It means 'don't focus the <body>, but it doesn't actively keep the focus — something on the new page might change it to something entirely different. The addition of the shallow: true option in #16449 magnifies this issue by defaulting keepFocus to true, even though a common use case is opening a modal which definitely should update the focused element.
And next to keepFocus, the noScroll name is weird. Names that describe what doesn't happen are bad at the best of times, but having a modifier like no alongside a verb like keep is unforgivable. We should try to use active (and more consistent) language.
Describe the proposed solution
goto(url, {
resetFocus: false,
resetScroll: false
});
Both options would default to true, except in the shallow: true case in which they would default to false.
Alternatives considered
No response
Importance
nice to have
Additional Information
No response
Describe the problem
Context here: #16449 (comment). Please no PRs for this until that one is merged.
Basically,
goto(url, { keepFocus: true })is a lie. It means 'don't focus the<body>, but it doesn't actively keep the focus — something on the new page might change it to something entirely different. The addition of theshallow: trueoption in #16449 magnifies this issue by defaultingkeepFocustotrue, even though a common use case is opening a modal which definitely should update the focused element.And next to
keepFocus, thenoScrollname is weird. Names that describe what doesn't happen are bad at the best of times, but having a modifier likenoalongside a verb likekeepis unforgivable. We should try to use active (and more consistent) language.Describe the proposed solution
Both options would default to
true, except in theshallow: truecase in which they would default tofalse.Alternatives considered
No response
Importance
nice to have
Additional Information
No response