极发无线电输入不响应Bootstrap类

发布于 2025-02-03 12:08:11 字数 1787 浏览 2 评论 0原文

将Bootstrap类添加到Blazor InputRadiogroup之后,无线电选项不再是交互式。他们在单击时不响应。当我打开表单时,它们将设置为当前值,但不能更改。直到我添加Bootstrap 4.0 custom-control类后,这才发生。

没有任何课程,无线电按钮可以工作:

<InputRadioGroup 
    TValue="Guid?"
    Value="guidVal"
    ValueChanged="e => 
    {
        guidVal = e;
    }"
    ValueExpression="() => guidVal">
    <div>
        <InputRadio Value="GUID_CONST_1" />
        <label>First</label>
    </div>
    <div>
        <InputRadio Value="GUID_CONST_2" />
        <label>Second</label>
    </div>
    <div>
        <InputRadio Value="GUID_CONST_3" />
        <label>Third</label>
    </div>
</InputRadioGroup>

当我添加课程时,它们停止响应:

<InputRadioGroup 
    TValue="Guid?"
    Value="guidVal"
    ValueChanged="e => 
    {
        guidVal = e;
    }"
    ValueExpression="() => guidVal">
    <div class="custom-control custom-radio custom-control-inline">
        <InputRadio class="custom-control-input" Value="GUID_CONST_1" />
        <label class="custom-control-label">First</label>
    </div>
    <div class="custom-control custom-radio custom-control-inline">
        <InputRadio class="custom-control-input" Value="GUID_CONST_1" />
        <label class="custom-control-label">Second</label>
    </div>
    <div class="custom-control custom-radio custom-control-inline">
        <InputRadio class="custom-control-input" Value="GUID_CONST_1" />
        <label class="custom-control-label">Third</label>
    </div>
</InputRadioGroup>

想知道是什么原因造成的。我在使用控件时看到浏览器控制台中没有错误或VS2022中的调试输出。

After adding bootstrap classes to a Blazor InputRadioGroup, the radio options are no longer interactive. They to not respond when clicked. When I open the form they are set to the current value but cannot be changed. This did not happen until after I added bootstrap 4.0 custom-control classes to the elements.

Without any classes, the radio buttons work:

<InputRadioGroup 
    TValue="Guid?"
    Value="guidVal"
    ValueChanged="e => 
    {
        guidVal = e;
    }"
    ValueExpression="() => guidVal">
    <div>
        <InputRadio Value="GUID_CONST_1" />
        <label>First</label>
    </div>
    <div>
        <InputRadio Value="GUID_CONST_2" />
        <label>Second</label>
    </div>
    <div>
        <InputRadio Value="GUID_CONST_3" />
        <label>Third</label>
    </div>
</InputRadioGroup>

When I add the classes, they stop being responsive:

<InputRadioGroup 
    TValue="Guid?"
    Value="guidVal"
    ValueChanged="e => 
    {
        guidVal = e;
    }"
    ValueExpression="() => guidVal">
    <div class="custom-control custom-radio custom-control-inline">
        <InputRadio class="custom-control-input" Value="GUID_CONST_1" />
        <label class="custom-control-label">First</label>
    </div>
    <div class="custom-control custom-radio custom-control-inline">
        <InputRadio class="custom-control-input" Value="GUID_CONST_1" />
        <label class="custom-control-label">Second</label>
    </div>
    <div class="custom-control custom-radio custom-control-inline">
        <InputRadio class="custom-control-input" Value="GUID_CONST_1" />
        <label class="custom-control-label">Third</label>
    </div>
</InputRadioGroup>

Wondering what is causing this. I see no errors in the browser console or the Debug output in VS2022 when using the controls.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文