Hello,
I use a RadzenAccordion. I want to have Sticky-Headers for the AccordionItems.
In my following code you can see the RadzenAccordion which contains Items which show a Markdown-To-HTML-File.
Until now the PageHeader (Release Notes) and the Buttons are Sticky. The Scrollview of the Accordion has a hight of 72vh under the Pageheader & Buttons. Which looks like this:
Now when i expand all, it looks like this:
I want that the head of the AccordionItem is Sticky when I scroll, so that I can see which release note I'm reading.
Here is my code:
<div class="release-notes-scroll-container">
<div style="display: flex; justify-content: center">
<div style="width: 80%;">
<div class="rz-p-sm-12">
<RadzenAccordion Multiple="true">
<Items>
@foreach (var file in _releaseNotes)
{
<RadzenAccordionItem Text="@file.FileNameWithoutExtension" Icon="description" @bind-Selected=@file.Selected>
<MarkdownContent Path="@file.FilePath" IsReleaseNote="true"/>
</RadzenAccordionItem>
}
</Items>
</RadzenAccordion>
</div>
</div>
</div>
</div>
The CSS:
/* CSS for the Sticky PageHeader and Buttons */
.release-notes-sticky-header-scroll-container {
position: sticky;
background-color: white;
z-index: 10;
padding-bottom: 20px;
}
/* CSS for the Scrollview for the Accordion */
.release-notes-scroll-container {
max-height: 72vh;
overflow-y: auto;
}