File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,17 @@ export default function ToolDashboard() {
48
48
} , 1000 ) ;
49
49
} , [ ] ) ;
50
50
51
+ // useEffect to scroll particular div into view
52
+ useEffect ( ( ) => {
53
+ setTimeout ( ( ) => {
54
+ const path = router . asPath
55
+ const id = path . slice ( path . indexOf ( "#" ) + 1 ) . replace ( "%20" , " " )
56
+ const element = document . getElementById ( id )
57
+ if ( element ) {
58
+ element . scrollIntoView ( { behavior : 'smooth' , block : "nearest" , inline : "nearest" } )
59
+ }
60
+ } , 1000 )
61
+ } , [ ] )
51
62
// useEffect function to enable the close Category dropdown Modal feature when clicked outside of the modal
52
63
useEffect ( ( ) => {
53
64
const checkIfClickOutside = ( e ) => {
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ export default function toolsList({ toolsData }) {
6
6
< div className = "" data-testid = "ToolsList-main" >
7
7
{ Object . keys ( toolsData ) . map ( ( categoryName , index ) => {
8
8
if ( toolsData [ categoryName ] . toolsList . length > 0 ) return (
9
- < div className = 'my-8' key = { index } id = { categoryName } >
9
+ < div className = 'my-8' key = { index } id = { categoryName } style = { { scrollMargin : "100px" } } >
10
10
< Heading typeStyle = 'heading-md-semibold' className = 'my-2' >
11
11
{ categoryName }
12
12
</ Heading >
You can’t perform that action at this time.
0 commit comments