fgilde / MudBlazor.Extensions

MudBlazor.Extensions from https://www.mudex.org is a small extension for MudBlazor from https://mudblazor.com
http://www.mudex.org
MIT License
245 stars 20 forks source link

Having ScrollSpy would be nice #82

Closed vgallegob closed 2 weeks ago

vgallegob commented 6 months ago

Feature request type

Enhance component

Component name

No response

Is your feature request related to a problem?

I want to make a sidebar like the one in the mudblazor docs, with the current scolled item highlited in the sidebar.

Describe the solution you'd like

Some components that handle the js initialization and disposal of event hadlers

Have you seen this feature anywhere else?

https://mudblazor.com/features/colors#theme-palette-colors

Describe alternatives you've considered

No response

Pull Request

No response

Code of Conduct

fgilde commented 6 months ago

Dont really get what you mean. Js init and disposing you can do as I do with this library https://github.com/fgilde/BlazorJS?tab=readme-ov-file#basecomponent-for-js-wrapper-components-

vgallegob commented 6 months ago

What I mean is having a pre-made MudExt component that allows having ScrollSpy built into the library. And not have to search and do interop, you know.

I know it's feasable to do it on my own, but I think this would be a valuable thing to include.

versile2 commented 1 month ago

Just for the record it's actually in MudBlazor just not documented and a "use at your own risk" type thing. MudPageContentNavigation https://github.com/MudBlazor/MudBlazor/pull/2188#issuecomment-940795769

ScarletKuro commented 1 month ago

MudBlazor already has a IScrollSpy interfaces that can be injected via DI if you need to spy a scroll. Unless I'm missing something. It's used in the MudPageContentNavigation btw, but as it says above use it at your own risk.

fgilde commented 1 month ago

I've created something new that maybe helps you. In general it's called MudExVirtualItem to have an virtualization behavior independent of a list. However because of the possibility of the Item to check when it is visible in scroll container and the event for visible changed it is maybe something that you can use. I created a demo page for it where it demonstarte how you can start loading something when a container is in the visible area.

Demo can found here currently. https://mudex.azurewebsites.net/virtual-item

Notice its not released yet but a preview package is available