Skip to content

Select 在开启搜索后第一次选择返回错误的值 #5917

Closed Answered by ArgoZhang
Vincent8725 asked this question in Q&A
Discussion options

You must be logged in to vote

@Vincent8725 经过调试发现微软的级联参数代码有一个逻辑是不正确的,刚好你这样写代码的时候就会触发这个逻辑

解决方案

  1. 弹窗逻辑
private async Task Callback(MouseEventArgs obj)
{
    var options = new EditDialogOption<Demo>
    {
        Model = model,
        DialogBodyTemplate = v => builder =>
        {
            builder.OpenComponent<Form>(0);
            builder.AddAttribute(1, "Model", model);
            builder.CloseComponent();

        }
    };
    await Dialog.ShowEditDialog(options);
}
  1. Form 组件逻辑
<EditorForm TModel="Demo">
    <FieldItems Context="v">
        <EditorItem @bind-Field="@v.Index">
            <EditTemplate Context="value">
                <div class="col-12 col-sm-6">
                    <Select @bind-Value="value.…

Replies: 4 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@Vincent8725
Comment options

@Vincent8725
Comment options

@ArgoZhang
Comment options

@Vincent8725
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by ArgoZhang
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Question that needs to be answered
2 participants
Converted from issue

This discussion was converted from issue #5892 on April 29, 2025 03:19.