Skip to content

Commit 2f7e04c

Browse files
committed
fix(kba): auto-scroll to top when opening draft
When clicking on a draft from the list after scrolling down, the page now automatically scrolls to the top with a smooth animation. This ensures users always start at the beginning of the draft content.
1 parent 22f1e0d commit 2f7e04c

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

frontend/src/features/kba-drafter/KBADrafterPage.jsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,13 @@ export default function KBADrafterPage() {
269269
}
270270
}, []);
271271

272+
// Auto-scroll to top when opening a draft
273+
useEffect(() => {
274+
if (currentDraft) {
275+
window.scrollTo({ top: 0, behavior: 'smooth' });
276+
}
277+
}, [currentDraft]);
278+
272279
// Handler: Check ticket status before generating KBA Draft
273280
const handleGenerateClick = async () => {
274281
if (!validateTicketId(ticketId)) {

0 commit comments

Comments
 (0)