Hi Gordon,
This issue is replicated because the dialog focuses
on the first elements of the content area which can be active and focusable. So,
we suggest you prevent this behavior by using the below code to get rid of your
faced issue.
Find the code example:
|
<SfDialog @ref="Dialog" IsModal="true" Width="450" Visible="false">
<DialogEvents Opened="@onOpen"></DialogEvents>
<DialogTemplates>
<Content>
<SfMultiSelect TValue="string[]" TItem="Countries" Placeholder="Select countries"
Mode="VisualMode.CheckBox" DataSource="@Country" ShowDropDownIcon="true" PopupHeight="250">
<MultiSelectFieldSettings Text="Name" Value="Code"></MultiSelectFieldSettings>
</SfMultiSelect>
</Content>
</DialogTemplates>
</SfDialog>
@code
{
private SfDialog Dialog { get; set; }
private void onOpen(OpenEventArgs args)
{
args.PreventFocus = true;
}
|
To know more about the preventing first element
focused state in the dialog component. Please refer to the documentation: https://blazor.syncfusion.com/documentation/dialog/how-to/prevent-the-focus-on-the-first-element
We have modified your provided sample based on your
requirement. Find the sample in the attachment here:
Regards,
Sureshkumar P
Attachment:
MultiselectDD_7cfc8b40.zip