[accordion] When large content is present in accordion. The active accordion is going out of viewport
Open
Nobody has claimed this yet.
has workaround
scope: accordion
type: new feature
waiting for 👍
- Dominant language
- JavaScript
- Stars
- 99.1k
- Forks
- 32.5k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 106
Description
Duplicates
Possible solution is suggested for V1 but nothing is there in V5
https://github.com/mui/material-ui/issues/12568
Latest version
- I have tested the latest version
Steps to reproduce 🕹
Steps:
- When large content is present in Accordion, the content is going out of viewport.
- Example link - https://codesandbox.io/s/distracted-sanne-rre74j?file=/demo.js
- Click on the first item to expand the accordion
- Now scroll to bottom and click on the 2nd to expand.
- Notice how the screen is not taken to the top of the accordion but stays at the bottom
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
Don't forget to mention which browser you used.
Output from `npx @mui/envinfo` goes here.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the accordion behavior in the linked CodeSandbox and compare it with the prior issue at #12568. Expand the first item, scroll to the bottom, then expand the second; done means the expanded section's top is brought into view instead of leaving the screen at the previous bottom position.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- accessibility, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100