angular-ngselect - 带有 labelForId 和 id 的 ng-select
问题描述
似乎 labelForId 用于 ng-Select ( https://github.com/ng-select ),它也有一个 ID它不起作用,即点击标签不会跳转到元素中。
如果我没有在 ng-select 的定义中添加 ID,它会起作用,但我的 IDE(intelliJ)会抛出"invalid id reference"。查看https://github.com/ng-select/ng-select/issues/1993上的附加图片
div class="row margin-top-25">
<div class="col-4">
<label for="one">One (WORKS but makes the IDE red)</label>
</div>
<div class="col-8">
<ng-select
labelForId="one">
<ng-option>Dog</ng-option>
<ng-option>Cat</ng-option>
</ng-select>
</div>
</div>
<div class="row margin-top-25">
<div class="col-4">
<label for="two">Two (DOES NOT WORK ☹️)</label>
</div>
<div class="col-8">
<ng-select
id="two"
labelForId="two">
<ng-option>Dog</ng-option>
<ng-option>Cat</ng-option>
</ng-select>
</div>
</div>
更新
对于每个有相同问题的人: https ://github.com/ng-select/ng-select/issues/1993#issuecomment-961218459
解决方案
推荐阅读
- electron - 电子锻造分布没有按预期工作
- javascript - 在图像上单击运行 javascript
- c# - DDD 架构
- windows - JMeter 负载测试 - HttpHostConnectException:连接被拒绝:在 windows server 2012 上连接
- javascript - 获取对象数组的内容,并将它们分配给 JSON 对象的属性
- javascript - 使用 XML 文件的 HTML 下拉菜单,但我希望将第二列的 2 列作为隐藏文本框,以供下一步参考过滤器
- android - LinearLayout 内部组件之间的边距
- asp.net-web-api - 使用 EFCore 过滤 ASp.net Core 中的数据
- angular - 字段“浏览器”在将模拟组件从库导入项目的 Angular 11 工作区中不包含有效的别名配置
- python - 查找某个字符串格式在长字符串中的位置