Skip to content

Commit

Permalink
- Fix #2390 by moving logic inside popover close code (#2393)
Browse files Browse the repository at this point in the history
- Fix #2391 by adding `Fixed` parameter t0 `FluentOverflowItem`

Co-authored-by: Denis Voituron <[email protected]>
  • Loading branch information
vnbaaij and dvoituron authored Jul 17, 2024
1 parent 5110baa commit 5ebaa3d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7025,6 +7025,12 @@
Gets True if this component is out of panel.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentOverflowItem.Fixed">
<summary>
Gets or sets if this item dos not participates in overflow logic.
Defaults to false
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentOverflowItem.Text">
<summary>
Gets the InnerText of <see cref="P:Microsoft.FluentUI.AspNetCore.Components.FluentOverflowItem.ChildContent"/>.
Expand Down Expand Up @@ -7219,7 +7225,7 @@
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentPopover.HorizontalInset">
<summary>
Gets or sets a value indicating whether the region overlaps the anchor on the horizontal axis.
Gets or sets a value indicating whether the region overlaps the anchor on the horizontal axis.
Default is true which places the region aligned with the anchor element.
</summary>
</member>
Expand Down
4 changes: 2 additions & 2 deletions src/Core/Components/Overflow/FluentOverflowItem.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@namespace Microsoft.FluentUI.AspNetCore.Components
@inherits FluentComponentBase

<div id="@Id" class="@ClassValue" style="@StyleValue" overflow=@Overflow>
<div id="@Id" class="@ClassValue" style="@StyleValue" overflow=@Overflow fixed="@(Fixed ? "fixed" : null)">
@ChildContent
</div>
</div>
7 changes: 7 additions & 0 deletions src/Core/Components/Overflow/FluentOverflowItem.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ public partial class FluentOverflowItem : IDisposable
[Parameter]
public RenderFragment? ChildContent { get; set; }

/// <summary>
/// Gets or sets if this item dos not participates in overflow logic.
/// Defaults to false
/// </summary>
[Parameter]
public bool Fixed { get; set; } = false;

/// <summary>
/// Gets True if this component is out of panel.
/// </summary>
Expand Down
4 changes: 2 additions & 2 deletions src/Core/Components/Popover/FluentPopover.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public partial class FluentPopover : FluentComponentBase
public HorizontalPosition? HorizontalPosition { get; set; } = AspNetCore.Components.HorizontalPosition.Unset;

/// <summary>
/// Gets or sets a value indicating whether the region overlaps the anchor on the horizontal axis.
/// Gets or sets a value indicating whether the region overlaps the anchor on the horizontal axis.
/// Default is true which places the region aligned with the anchor element.
/// </summary>
[Parameter]
Expand Down Expand Up @@ -130,11 +130,11 @@ protected override void OnParametersSet()
protected virtual async Task CloseAsync()
{
Open = false;
await AnchoredRegion.FocusToOriginalElementAsync();
if (OpenChanged.HasDelegate)
{
await OpenChanged.InvokeAsync(Open);
}
await AnchoredRegion.FocusToOriginalElementAsync();
}

/// <summary />
Expand Down

0 comments on commit 5ebaa3d

Please sign in to comment.