mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-09 21:33:48 +00:00
Improved chat page by scrolling to the bottom after loading (#87)
This commit is contained in:
1 parent
3409872090
commit
1b3fff67ec
9 files changed
+57
-2
No files matched your search
@@ -3,6 +3,10 @@
|
||||
<div class="d-flex flex-column" style="@this.Height">
|
||||
<div class="flex-auto overflow-auto">
|
||||
@this.ChildContent
|
||||
|
||||
<div @ref="@this.AnchorAfterChildContent">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@this.FooterContent
|
||||
|
||||
@@ -26,6 +26,11 @@ public partial class InnerScrolling : MSGComponentBase
|
||||
|
||||
[CascadingParameter]
|
||||
private MainLayout MainLayout { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
private IJSRuntime JsRuntime { get; init; } = null!;
|
||||
|
||||
private ElementReference AnchorAfterChildContent { get; set; }
|
||||
|
||||
#region Overrides of ComponentBase
|
||||
|
||||
@@ -59,4 +64,9 @@ public partial class InnerScrolling : MSGComponentBase
|
||||
#endregion
|
||||
|
||||
private string Height => $"height: calc(100vh - {this.HeaderHeight} - {this.MainLayout.AdditionalHeight});";
|
||||
|
||||
public async Task ScrollToBottom()
|
||||
{
|
||||
await this.AnchorAfterChildContent.ScrollIntoViewAsync(this.JsRuntime);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user