feat(Core.Components):Add Scrollable component and its gallery. #114
Merged
TeseySTD merged 7 commits intoRazorConsole:mainfrom Nov 15, 2025
Merged
feat(Core.Components):Add Scrollable component and its gallery. #114TeseySTD merged 7 commits intoRazorConsole:mainfrom
TeseySTD merged 7 commits intoRazorConsole:mainfrom
Conversation
src/RazorConsole.Core/Vdom/Translators/HtmlListElementTranslator.cs
Outdated
Show resolved
Hide resolved
1c2a299 to
72f04b2
Compare
Signed-off-by: Skoreyko Misha <150385054+TeseySTD@users.noreply.github.com>
Updated ordered list to use 'start' attribute for correct numbering. Signed-off-by: Skoreyko Misha <150385054+TeseySTD@users.noreply.github.com>
…ode. Signed-off-by: Skoreyko Misha <150385054+TeseySTD@users.noreply.github.com>
LittleLittleCloud
approved these changes
Nov 15, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
As I mentioned in #111 issue, I'd like to add scroll ability to some components like Tables and Lists.
In this pull request I implemented a simple wrapper component, that enables item scrolling for any data collection with any rendering, not bound to any component at all.
What was done
ItemsIReadOnlyList<TItem>Array.Empty<TItem>()PageSizeint1ChildContentRenderFragment<ScrollContext<TItem>>ScrollOffsetint0ScrollOffsetChangedEventCallback<int>Component provide the children its context, where is the keyboard callback and some info
this[int i]TItemi.CountintGetEnumerator()foreach.KeyDownEventHandlerFunc<KeyboardEventArgs,Task>@onkeydown.CurrentOffsetintScrollOffset.PagesCountintPageSize >= Items.Count ? 1 : Items.Count - PageSize + 1.olelement data-offset attribute to render the correct number using offset.Here is the example:
P.S. I'm not sure if the api of the component made well - maybe there is the simpler solution, idk. Also, if code quality is bad somewhere - write about it, and I'll try to fix that.