fix: ensure selection is cleared on entry change

- Added a useEffect hook to clear selection whenever the entryId changes, improving the component's responsiveness to entry updates.

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei 2025-11-20 21:54:09 +08:00
parent 30fffb9965
commit 4e3e1c1513
No known key found for this signature in database
GPG Key ID: 0F62D33977F021F7
1 changed files with 4 additions and 0 deletions

View File

@ -91,6 +91,10 @@ export const ArticleLayout: React.FC<EntryLayoutProps> = ({
handleSelectionClear()
}, [showTranscript, handleSelectionClear])
useEffect(() => {
handleSelectionClear()
}, [entryId, handleSelectionClear])
if (!entry) return null
return (