Skip to content

Commit 566e2c1

Browse files
authored
Merge pull request #12495 from github/repo-sync
repo sync
2 parents c789ff1 + 7569060 commit 566e2c1

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)