I've built a custom accordion component, but I'm encountering scrolling issues when trying to use nested levels within the accordion. I'd like to prevent scrolling inside the accordion section and instead have the page scroll below it.
Any suggestions on how to achieve this?
App.js
import Accordion from "./Accordion";
export default function App() {
return (
<div>
<Accordion title="What is lorem ipsum?">
<Accordion title="What is lorem ipsum?">
Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text ever
since the 1500s.
</Accordion>
<Accordion title="What is lorem ipsum?">
<ul>
<li>
a) Lorem Ipsum is simply dummy text of the printing and
typesetting industry.{" "}
</li>
<li>
b) Lorem Ipsum is simply dummy text of the printing and
typesetting industry.{" "}
</li>
<li>
c) Lorem Ipsum is simply dummy text of the printing and
typesetting industry.{" "}
</li>
<li>
d) Lorem Ipsum is simply dummy text of the printing and
typesetting industry.{" "}
</li>
</ul>
</Accordion>
</Accordion>
<Accordion title="What is lorem ipsum?">
Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text ever
since the 1500s.
</Accordion>
<Accordion title="What is lorem ipsum?">
<ul>
<li>
a) Lorem Ipsum is simply dummy text of the printing and typesetting
industry.{" "}
</li>
<li>
b) Lorem Ipsum is simply dummy text of the printing and typesetting
industry.{" "}
</li>
<li>
c) Lorem Ipsum is simply dummy text of the printing and typesetting
industry.{" "}
</li>
<li>
d) Lorem Ipsum is simply dummy text of the printing and typesetting
industry.{" "}
</li>
</ul>
</Accordion>
</div>
);
}
If you want to see the code in action, check out the codesandbox link
Any assistance would be greatly appreciated