Skip to content

bug(SelectObject): 未设置Required时仍然出现必填*号 #5461

@tiansfather

Description

@tiansfather

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

在表单中使用时,SelectObject总是出现必填星号
`@page "/"
@Attribute [TabItemOption(Text = "Index", Closable = false)]

    <div class="col-12">
        <Select @bind-Value="model.Icon" Items="_items">
        </Select>
    </div>

    <div class="col-12">
        <SelectObject @bind-Value="model.Icon" GetTextCallback="@(item => item)" Height="300"  DropdownMinWidth="300">
            <ListView  Items="@_items2">
                <BodyTemplate Context="value">
                    <Card>
                        <BodyTemplate>                                
                            <div class="lv-demo-desc">@value</div>
                        </BodyTemplate>
                    </Card>
                </BodyTemplate>
            </ListView>
        </SelectObject>
    </div>
</div>

@code {
private List _items=new List();
private List _items2=new List() { "a","b"};
private Model model = new Model();
class Model
{
public string Icon { get; set; }
}
}
`

Image

Expected Behavior

SelectObject和SelectTable好像都有这个问题,属性未设置Required特性时仍然会出现必填星号

Interactive render mode

Interactive Server (Interactive server-side rendering (interactive SSR) using Blazor Server)

Steps To Reproduce

https://gitee.com/tiansfather/bbdemo.git

Exceptions (if any)

No response

.NET Version

NET8.0

Anything else?

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions