Allow additional styles & fixes missed min. width

This commit is contained in:
Thorsten Sommer 2025-01-21 13:32:06 +01:00
parent 91975d0b28
commit d08be4103e
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
2 changed files with 9 additions and 2 deletions

View File

@ -1,6 +1,6 @@
@inherits MSGComponentBase
<div class="@this.Classes" style="flex-grow: 1; overflow: hidden;">
<div class="@this.Classes" style="@this.Styles">
@if (this.HeaderContent is not null)
{
<div>

View File

@ -26,6 +26,9 @@ public partial class InnerScrolling : MSGComponentBase
[Parameter]
public string? MinWidth { get; set; }
[Parameter]
public string Style { get; set; } = string.Empty;
[CascadingParameter]
private MainLayout MainLayout { get; set; } = null!;
@ -66,10 +69,14 @@ public partial class InnerScrolling : MSGComponentBase
#endregion
private string MinWidthStyle => string.IsNullOrWhiteSpace(this.MinWidth) ? string.Empty : $"min-width: {this.MinWidth};";
private string MinWidthStyle => string.IsNullOrWhiteSpace(this.MinWidth) ? string.Empty : $"min-width: {this.MinWidth}; ";
private string TerminatedStyles => string.IsNullOrWhiteSpace(this.Style) ? string.Empty : $"{this.Style}; ";
private string Classes => this.FillEntireHorizontalSpace ? $"{this.Class} d-flex flex-column flex-grow-1" : $"{this.Class} d-flex flex-column";
private string Styles => $"flex-grow: 1; overflow: hidden; {this.TerminatedStyles}{this.MinWidthStyle}";
public async Task ScrollToBottom()
{
await this.AnchorAfterChildContent.ScrollIntoViewAsync(this.JsRuntime);