Get 2025 Templates Mega Bundle!$1000 worth of 19 Bootstrap HTML, Vue & React Templates + 3 Vector Sets for just $99
Get for 99$

Metronic react Theme sidebar scrolling issue


Hii,

I got sidebar scroll issue as shown in below screencast. When I move to any pages which don't have side bar i.e. in 404 page as shown in video, Then I move back to pages in which side bar is there then in this case sidebar hang up and can't able to scroll sidebar. I must refresh page for working properly again.

If anyone have solution then please let me know it will help a lot to me.

Please find below screencast for mentioned issue.
https://www.loom.com/share/89c242737fd74296a6d16903d8b18108

Thanks.


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (1)


Hi,

We reproduced this error. The issue is related to our components initialization, currently, ScrollComponent gets initialized only on the first-page load.

To fix this you can change the file src/_metronic/helpers/initializationHelper.ts with the content below which will reinitialize all components when the router gets changed:

import {ReactNode} from "react"
import {
DrawerComponent,
MenuComponent,
ScrollComponent,
StickyComponent, SwapperComponent,
ToggleComponent
} from "../assets/ts/components"

type WithChildren = {
children?: ReactNode
}

const reInitMenu = () => {
setTimeout(() => {
ToggleComponent.reinitialization();
StickyComponent.reInitialization();
MenuComponent.reinitialization();
ScrollComponent.reinitialization();
DrawerComponent.reinitialization();
SwapperComponent.reinitialization();
}, 500)
}

export {type WithChildren, reInitMenu}


Regards,
Lauris Stepanovs,
Keenthemes Support Team


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(