Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
[FEAT] - In the FluentAutocomplete, the Position property was changed…
… to type SelectPosition?.
  • Loading branch information
pedro-cons committed Apr 21, 2025
commit 0fd3797cbcec0b2c48bd9576cc0f0803f98aa6d6
Original file line number Diff line number Diff line change
Expand Up @@ -5909,7 +5909,7 @@
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentAutocomplete`1.Position">
<summary>
Gets or sets the vertical default position of the options popup.
Gets or sets the position of the options popup.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentAutocomplete`1.Value">
Expand Down Expand Up @@ -6104,6 +6104,12 @@
<member name="M:Microsoft.FluentUI.AspNetCore.Components.FluentAutocomplete`1.RaiseValueTextChangedAsync(System.String)">
<summary />
</member>
<member name="M:Microsoft.FluentUI.AspNetCore.Components.FluentAutocomplete`1.GetVerticalPosition">
<summary>
Gets the position of the popup.
</summary>
<returns></returns>
</member>
<member name="M:Microsoft.FluentUI.AspNetCore.Components.FluentAutocomplete`1.MustBeClosed">
<summary />
</member>
Expand Down
4 changes: 2 additions & 2 deletions src/Core/Components/List/FluentAutocomplete.razor
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
<FluentAnchoredRegion Anchor="@Id"
HorizontalDefaultPosition="HorizontalPosition.Right"
HorizontalInset="true"
VerticalDefaultPosition="Position"
VerticalDefaultPosition="GetVerticalPosition()"
Style="margin-top: 10px; border-radius: calc(var(--control-corner-radius) * 2px); background-color: var(--neutral-layer-floating);"
Shadow="ElevationShadow.Flyout">
@if (HeaderContent != null)
Expand Down Expand Up @@ -160,7 +160,7 @@
<FluentAnchoredRegion Anchor="@Id"
HorizontalDefaultPosition="HorizontalPosition.Right"
HorizontalInset="true"
VerticalDefaultPosition="Position"
VerticalDefaultPosition="GetVerticalPosition()"
Style="margin-top: 10px; border-radius: calc(var(--control-corner-radius) * 2px); background-color: var(--neutral-layer-floating); padding: 10px;"
Shadow="ElevationShadow.Flyout">
@MaximumSelectedOptionsMessage
Expand Down
16 changes: 14 additions & 2 deletions src/Core/Components/List/FluentAutocomplete.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ public FluentAutocomplete()
public EventCallback<string> ValueTextChanged { get; set; }

/// <summary>
/// Gets or sets the vertical default position of the options popup.
/// Gets or sets the position of the options popup.
/// </summary>
[Parameter]
public VerticalPosition Position { get; set; } = VerticalPosition.Unset;
public SelectPosition? Position { get; set; }

/// <summary>
/// Gets or sets the value of the input. This should be used with two-way binding.
Expand Down Expand Up @@ -657,6 +657,18 @@ private async Task RaiseValueTextChangedAsync(string value)

}

/// <summary>
/// Gets the position of the popup.
/// </summary>
/// <returns></returns>
private VerticalPosition? GetVerticalPosition()
=> Position switch
{
SelectPosition.Above => VerticalPosition.Top,
SelectPosition.Below => VerticalPosition.Bottom,
_ => VerticalPosition.Unset,
};

/// <summary />
private bool MustBeClosed()
{
Expand Down
Loading