mdc - 将部分视图附加到差异 ID 时未计算 mdc-floatin-label 宽度
问题描述
我将部分视图附加到 div 标签。
if (typeof response != "undefined") {
$("#" + formID).find('#captcha-section').html(response);
}
我的浮动标签 HTML 代码
<label asp-for="ImageText" class="mdc-text-field text-field mdc-text-field--outlined phone-otp-label">
<input asp-for="ImageText" class="mdc-text-field__input"
aria-labelledby="lblImage"
aria-describedby="helperImage"
aria-controls="helperImage">
<span class="mdc-notched-outline">
<span class="mdc-notched-outline__leading"></span>
<span class="mdc-notched-outline__notch">
<span class="mdc-floating-label" id="lblImage">@Model.ImageTextLabel</span>
</span>
<span class="mdc-notched-outline__trailing"></span>
</span>
</label>
此处浮动标签未按预期工作。 在此处输入图像描述
解决方案
推荐阅读
- postgresql - 使用 NHibernate 映射复合键的问题(已添加列)
- python - LeetCode 的“迷宫 II”问题:为什么这个解决方案会超过时间限制?
- java - 响应 HTML 是重复行
- android - 具有交互性的 android 中的 3D 模型渲染
- json - 如何构建一个滑块,该滑块从 Laravel 中的 JSON 数据中获取图像的 url
- angular - 选择选项时如何动态添加表格行?
- python - 使用启用了 Cookie 的 Python 请求进行 Web 爬网
- php - 使用 Laravel 5.8 对没有数据库(计数)的 API 响应进行分页
- python-3.x - 为什么迭代和修改嵌套列表中的每个元素会导致一些错误的输出?
- java - 读入 1000 个素数文本文件?