Skip to content

[select] 远程搜索模式 输入触发事件后异常 #464

Closed
@Seanxwy

Description

默认为select控件加载数据,点击选项使用没有问题,当输入内容进行远程搜索时,能正确触发事件,远程搜索返回正确返回数据后,就出现了异常,导致服务终止。
image

<Select ShowSearch  Style="width:200px" Placeholder="可输入搜索"   ShowArrow="false"  FilterOption="false"  DefaultActiveFirstOption="false"   @bind-Value="@context.SchoolId"  OnSearch="@OnSchoolSearch"  OnChange="@OnSchoolChange">

                        @foreach (var value in _items)
                        {
                            <SelectOption Value="@value.SchoolId.ToString()">@value.SchoolName</SelectOption>
                        }

                    </Select>
private List<School> _items = new List<School>();

    private async void OnSchoolSearch(string value)
    {
        _items = await SchoolService.Suggest(value);

    }

    private async void OnSchoolChange(OneOf<string, IEnumerable<string>, LabeledValue, IEnumerable<LabeledValue>> value, OneOf<SelectOption, IEnumerable<SelectOption>> option)
    {
    }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      [select] 远程搜索模式 输入触发事件后异常 · Issue #464 · ant-design-blazor/ant-design-blazor