fisshy / react-scroll

React scroll component
https://github.com/fisshy/react-scroll/blob/master/README.md
MIT License
4.35k stars 436 forks source link

ScrollSpy unable to reset or unmount #574

Closed SadanandaS-nc closed 8 months ago

SadanandaS-nc commented 9 months ago

Hi,

i have component Advanced screen where in the vertical tab i am using react-scroll and if user navigates to Search screen which contains same Advanced screen inside a material ui dialog scrollspy is not working correctly but if i refresh the page and go the dialog that contains Advanced screen it is working correctly not sure what is the issue i am facing.

i am not handling any state and also for the Advanced screen inside dialog i am using containerId.Anyone please help me.

                         <Link
                            activeClass={`font-family-atlas-black
                            ${
                                item?.id >= 3 && item?.id <= 5
                                    ? 'chr-of-advanced-search--vertical-menu-item_expanded'
                                    : 'chr-of-advanced-search--vertical-menu-item_active'
                            }
                            `}
                            className="font-family-atlas-medium"
                            containerId={
                                isAmendSeach
                                    ? 'amend-search-dialog'
                                    : undefined
                            }
                            smooth={true}
                            spy={true}
                            to={item?.key}
                            offset={-150}
                            key={item?.id}

                        >
                            <li className="cursor-pointer chr-of-advanced-search--vertical-menu-item_list">
                                {item?.label}
                            </li>
                        </Link>

@fisshy can you please help me on this.This is very urgent issue. This is related to the same caching issue where on refresh it is working perfectly fine.