Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -5907,6 +5907,11 @@
Gets or sets the callback that is invoked when the text field value changes.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentAutocomplete`1.Position">
<summary>
Gets or sets the position of the options popup.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentAutocomplete`1.Value">
<summary>
Gets or sets the value of the input. This should be used with two-way binding.
Expand Down Expand Up @@ -6099,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="@VerticalPosition.Unset"
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="@VerticalPosition.Unset"
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
18 changes: 18 additions & 0 deletions src/Core/Components/List/FluentAutocomplete.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ public FluentAutocomplete()
[Parameter]
public EventCallback<string> ValueTextChanged { get; set; }

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

/// <summary>
/// Gets or sets the value of the input. This should be used with two-way binding.
/// For the FluentAutocomplete component, use the <see cref="ValueText"/> property instead.
Expand Down Expand Up @@ -651,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