File tree 1 file changed +3
-1
lines changed
docs/src/modules/components
1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import Typography from '@material-ui/core/Typography';
11
11
import textToHash from 'docs/src/modules/utils/textToHash' ;
12
12
import DiamondSponsors from 'docs/src/modules/components/DiamondSponsors' ;
13
13
import Link from 'docs/src/modules/components/Link' ;
14
+ import PageContext from 'docs/src/modules/components/PageContext' ;
14
15
15
16
const useStyles = makeStyles ( theme => ( {
16
17
root : {
@@ -155,6 +156,7 @@ export default function AppTableOfContents(props) {
155
156
itemsClientRef . current = getItemsClient ( itemsServer ) ;
156
157
} , [ itemsServer ] ) ;
157
158
159
+ const { activePage } = React . useContext ( PageContext ) ;
158
160
const [ activeState , setActiveState ] = React . useState ( null ) ;
159
161
const clickedRef = React . useRef ( false ) ;
160
162
const unsetClickedRef = React . useRef ( null ) ;
@@ -233,7 +235,7 @@ export default function AppTableOfContents(props) {
233
235
< Link
234
236
display = "block"
235
237
color = { activeState === item . hash ? 'textPrimary' : 'textSecondary' }
236
- href = { `#${ item . hash } ` }
238
+ href = { `${ activePage . pathname } #${ item . hash } ` }
237
239
underline = "none"
238
240
onClick = { handleClick ( item . hash ) }
239
241
className = { clsx (
You can’t perform that action at this time.
0 commit comments