Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fixed auto scroll not working when configure provider button is … #5282

Open
wants to merge 6 commits into
base: next
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,10 @@ export function SelectProviderSidebar({
};

useEffect(() => {
onTabChange(scrollTo?.toString());
}, [onTabChange, scrollTo]);
setTimeout(() => {
onTabChange(scrollTo?.toString());
}, 100);
}, []);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there will be an ESLint warning about missing deps, please fix it

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure @LetItRock ,Just added the dependency . Was just curios about why we are putting onTabChange function as deps , we are scrolling once we land to the page .After that any tab changes , the onTabChange function will trigger the scrolling .

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's safe to put the onTabChange here in the deps array, because it's memoized and won't change during the re-renders ;)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it 👍


return (
<Sidebar
Expand Down