Hello,
I have found that with Autofill="false", after entering some filter text in the auto complete text box I can navigate up and down the popup list of items without the value in the text box changing until I press Enter or Tab to select an item as expected.
However, if I use Page Up or Page Down to navigate the list then the component automatically populates the text box with the item I have paged to which is NOT what I would expect.
How can I prevent Page Up and Page Down from populating the text box?
Thanks,
Hello,
Thank you for your reply.
However, according to the documentation using the Page Up and Page Down keys are supposed to work like the Arrow Up and Arrow Down keys. They are supposed to select the item but NOT set it into the set it into the AutoComplete component. Whereas if you look at the documentation for the Enter key, it is supposed to set the value into the AutoComplete component.
Furthermore, it doesn't make sense that Page up and Page down set the selection into the AutoComplete component when AutoComplete="false" because they leave the popup open and are just to navigate the list.
See here for documentation on the keyboard interaction Accessibility in Blazor AutoComplete Component | Syncfusion
Thanks,
Chuck
|
@inject IJSRuntime JSRuntime
<SfAutoComplete ID="SyncAutocomplete" TValue="string" TItem="GameFields" Autofill="true" Placeholder="e.g. Basketball" DataSource="@Games">
<AutoCompleteFieldSettings Value="Text" />
</SfAutoComplete>
@code{
protected override Task OnInitializedAsync()
{
JSRuntime.InvokeVoidAsync("preventAction");
return base.OnInitializedAsync();
}
public class GameFields
{
public string ID { get; set; }
public string Text { get; set; }
}
private List<GameFields> Games = new List<GameFields>()
{
new GameFields(){ ID= "Game1", Text= "American Football" },
new GameFields(){ ID= "Game2", Text= "Badminton" },
new GameFields(){ ID= "Game3", Text= "Basketball" },
new GameFields(){ ID= "Game4", Text= "Cricket" },
new GameFields(){ ID= "Game5", Text= "Football" },
new GameFields(){ ID= "Game6", Text= "Golf" },
new GameFields(){ ID= "Game7", Text= "Hockey" },
new GameFields(){ ID= "Game8", Text= "Rugby"},
new GameFields(){ ID= "Game9", Text= "Snooker" },
new GameFields(){ ID= "Game10", Text= "Tennis"}
};
public string DropDownValue = "Game3";
public string ChangeValue { get; set; } = "Basketball";
}
|