【问题标题】:React with bootstrap checkbox disabled attribute not working对引导复选框禁用属性做出反应不起作用
【发布时间】:2019-04-19 15:48:16
【问题描述】:
<input {...{type: 'checkbox', name, checked, readOnly: true, disabled: true}} />

谁能告诉我为什么我的复选框没有被禁用?

感谢任何帮助!

【问题讨论】:

标签: javascript html reactjs react-bootstrap


【解决方案1】:

发现问题:onClick 处理程序位于输入标记(父 div)的上一级。 如果你这样做,它应该可以按预期工作:

<input {...{type: 'checkbox', name, checked, onClick: this.onChange, disabled: false}} />

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-08-06
    • 2020-09-24
    • 2022-11-22
    • 2016-07-30
    • 1970-01-01
    • 2018-11-12
    • 2021-01-13
    相关资源
    最近更新 更多