-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[material-ui][Accordion] Content should be scrolled into view when expanded #40625
Comments
Hey @rishav001own, thanks for the report! I agree this would be a good enhancement. Here's the current behavior: Screen.Recording.2024-01-16.at.10.47.48.movI added the WorkaroundThere's a workaround using Screen.Recording.2024-01-16.at.11.13.47.mov |
is there any update?? |
@rishav001own does the proposed workaround work for you? Regarding implementing this behavior on Material UI's side, we'll have to wait for more upvotes. |
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as spam.
This comment was marked as spam.
I implemented it like this here and seems to work fine :) |
This issue reminds me of #22152. The solution looks straightforward: I can't reproduce the issue in #22152 in the latest version of Chrome, so we might want to revert #22292 to close this issue. |
My solution: const handleChange = (event: SyntheticEvent<Element, Event>, expanded: boolean) => {
onChange?.(event, expanded);
if (expanded) {
setTimeout(() => {
accordionRef.current?.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
}, theme.transitions.duration.standard);
}
}; Any simple resolution for current now? @oliviertassinari |
@tjx666 have you tried the workaround in this comment? |
@DiegoAndai works, thanks |
This issue is duplicate of #34379 |
Thanks for pointing it out @ZeeshanTamboli, closing this as a duplicate of #34379 |
Steps to reproduce
Link to live example: (required)
Steps:
3.To expand the accordion, click the first item.
Present actions
At the end of the extended accordion, the screen remains
Anticipated conduct
Priority should be given to the larger section's content.
Current behavior
Screen stays at end of the expanded accordion
Expected behavior
Focus should be on top of the content on the expanded section
Context
No response
Your environment
npx @mui/envinfo
Search keywords: accordion scrolling to down
The text was updated successfully, but these errors were encountered: