Skip to content

Commit 97289d0

Browse files
authored
Merge branch 'main' into repo-sync
2 parents bb55a14 + 39cdb0d commit 97289d0

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

components/article/ToolPicker.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,15 @@ export const ToolPicker = ({ variant = 'subnav' }: Props) => {
8080
}
8181
}, [])
8282

83-
function onClickTool(tool: string) {
84-
setCurrentTool(tool)
83+
// Whenever the currentTool is changed, update the article content
84+
useEffect(() => {
8585
preserveAnchorNodePosition(document, () => {
86-
showToolSpecificContent(tool)
86+
showToolSpecificContent(currentTool)
8787
})
88+
}, [currentTool])
89+
90+
function onClickTool(tool: string) {
91+
setCurrentTool(tool)
8892
sendEvent({
8993
type: EventType.preference,
9094
preference_name: 'application',

0 commit comments

Comments
 (0)