Skip to content

Commit cbae1fb

Browse files
Overwrite FocusAsync in FluentAutoComplete (#4230)
Co-authored-by: Vincent Baaij <vnbaaij@outlook.com>
1 parent 4d5461a commit cbae1fb

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

examples/Demo/Shared/Microsoft.FluentUI.AspNetCore.Components.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6227,6 +6227,12 @@
62276227
<member name="M:Microsoft.FluentUI.AspNetCore.Components.FluentAutocomplete`1.MustBeClosed">
62286228
<summary />
62296229
</member>
6230+
<member name="M:Microsoft.FluentUI.AspNetCore.Components.FluentAutocomplete`1.FocusAsync">
6231+
<inheritdoc />
6232+
</member>
6233+
<member name="M:Microsoft.FluentUI.AspNetCore.Components.FluentAutocomplete`1.FocusAsync(System.Boolean)">
6234+
<inheritdoc />
6235+
</member>
62306236
<member name="T:Microsoft.FluentUI.AspNetCore.Components.HeaderFooterContent`1">
62316237
<summary />
62326238
</member>

src/Core/Components/List/FluentAutocomplete.razor.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,32 @@ private bool MustBeClosed()
706706

707707
return false;
708708
}
709+
710+
/// <inheritdoc />
711+
public override void FocusAsync()
712+
{
713+
if (Multiple)
714+
{
715+
Element?.FocusAsync();
716+
}
717+
else
718+
{
719+
OnDropDownExpandedAsync();
720+
}
721+
}
722+
723+
/// <inheritdoc />
724+
public override void FocusAsync(bool preventScroll)
725+
{
726+
if (Multiple)
727+
{
728+
Element?.FocusAsync(preventScroll);
729+
}
730+
else
731+
{
732+
OnDropDownExpandedAsync();
733+
}
734+
}
709735
}
710736

711737
/// <summary />

0 commit comments

Comments
 (0)