mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-28 17:50:28 +08:00
Fix issue scrolled to the bottom on navigation
If the issue with comments is taller than the viewport then the focus on the comment reply at the bottom of it would cause the page to be scrolled to the end when navigating from the issue list. We want to always open the issue page at the top, this fixes it.
This commit is contained in:
@@ -64,6 +64,7 @@
|
||||
let updatedTitle = $state("");
|
||||
let labelSaveInProgress: boolean = $state(false);
|
||||
let assigneesSaveInProgress: boolean = $state(false);
|
||||
let focusReply: boolean = $state(false);
|
||||
|
||||
$effect(() => {
|
||||
// The component doesn't get destroyed when we switch between different
|
||||
@@ -77,6 +78,7 @@
|
||||
topLevelReplyOpen = false;
|
||||
editingTitle = false;
|
||||
updatedTitle = issue.title;
|
||||
focusReply = false;
|
||||
});
|
||||
|
||||
const project = $derived(repo.payloads["xyz.radicle.project"]!);
|
||||
@@ -132,6 +134,7 @@
|
||||
behavior: "smooth",
|
||||
block: "center",
|
||||
});
|
||||
focusReply = true;
|
||||
}
|
||||
|
||||
async function reload() {
|
||||
@@ -541,7 +544,7 @@
|
||||
<CommentToggleInput
|
||||
disallowEmptyBody
|
||||
rid={repo.rid}
|
||||
focus
|
||||
focus={focusReply}
|
||||
onexpand={toggleReply}
|
||||
onclose={topLevelReplyOpen
|
||||
? () => (topLevelReplyOpen = false)
|
||||
|
||||
Reference in New Issue
Block a user