Interface IScrollManager
- Namespace
- MudBlazor
- Assembly
- MudBlazor.dll
Provides methods for managing scroll behavior.
public interface IScrollManager
- Extension Methods
Methods
LockScrollAsync(string, string)
Locks the scroll for the element matching the specified selector by adding a CSS class.
ValueTask LockScrollAsync(string selector = "body", string cssClass = "scroll-locked")
Parameters
selector
stringThe CSS selector of the element to lock scroll. Defaults to "body".
cssClass
stringThe CSS class to add to lock scroll. Defaults to "scroll-locked".
Returns
- ValueTask
A task that represents the asynchronous operation.
ScrollIntoViewAsync(string?, ScrollBehavior)
Scrolls the element matching the specified selector into view.
ValueTask ScrollIntoViewAsync(string? selector, ScrollBehavior behavior)
Parameters
selector
stringThe CSS selector of the element to scroll into view.
behavior
ScrollBehaviorThe scroll behavior (e.g., smooth or auto).
Returns
- ValueTask
A task that represents the asynchronous operation.
ScrollToAsync(string?, int, int, ScrollBehavior)
Scrolls to the specified position within the element with the given ID.
ValueTask ScrollToAsync(string? id, int left, int top, ScrollBehavior scrollBehavior)
Parameters
id
stringThe ID of the element to scroll.
left
intThe horizontal scroll position.
top
intThe vertical scroll position.
scrollBehavior
ScrollBehaviorThe scroll behavior (e.g., smooth or auto).
Returns
- ValueTask
A task that represents the asynchronous operation.
ScrollToBottomAsync(string, ScrollBehavior)
Scrolls to the bottom of the element with the given ID.
ValueTask ScrollToBottomAsync(string elementId, ScrollBehavior scrollBehavior = ScrollBehavior.Auto)
Parameters
elementId
stringThe ID of the element to scroll.
scrollBehavior
ScrollBehaviorThe scroll behavior (e.g., smooth or auto). Defaults to auto.
Returns
- ValueTask
A task that represents the asynchronous operation.
ScrollToListItemAsync(string)
Scrolls to the list item element with the given ID.
ValueTask ScrollToListItemAsync(string elementId)
Parameters
elementId
stringThe ID of the list item element to scroll.
Returns
- ValueTask
A task that represents the asynchronous operation.
ScrollToTopAsync(string?, ScrollBehavior)
Scrolls to the top of the element with the given ID.
ValueTask ScrollToTopAsync(string? id, ScrollBehavior scrollBehavior = ScrollBehavior.Auto)
Parameters
id
stringThe ID of the element to scroll.
scrollBehavior
ScrollBehaviorThe scroll behavior (e.g., smooth or auto). Defaults to auto.
Returns
- ValueTask
A task that represents the asynchronous operation.
ScrollToYearAsync(string)
Scrolls to the year element with the given ID.
ValueTask ScrollToYearAsync(string elementId)
Parameters
elementId
stringThe ID of the year element to scroll.
Returns
- ValueTask
A task that represents the asynchronous operation.
UnlockScrollAsync(string, string)
Unlocks the scroll for the element matching the specified selector by removing a CSS class.
ValueTask UnlockScrollAsync(string selector = "body", string cssClass = "scroll-locked")
Parameters
selector
stringThe CSS selector of the element to unlock scroll. Defaults to "body".
cssClass
stringThe CSS class to remove to unlock scroll. Defaults to "scroll-locked".
Returns
- ValueTask
A task that represents the asynchronous operation.