gpt4 book ai didi

html - 文本区域不随回车调整大小或扩展

转载 作者:行者123 更新时间:2023-11-28 06:12:55 24 4
gpt4 key购买 nike

当我的光标位于该区域的底部时,我的文本区域没有扩展,我按回车键创建了一个新行。我可以在我的应用程序中扩展我的其他一些文本区域,所以我认为它周围有一些元素阻止它在我键入时扩展/重新调整大小?有什么想法吗?

这是我的 html 和呈现的 html

<div class="form-group">
@Html.LabelFor(model => model.OverviewSummary, new { @class = "control-label" })
<form id="OverviewSummarySubmit">
@Html.TextAreaFor(model => model.OverviewSummary, new { @class = "form-control input-lg", @style = "min-height: 64px; max-height: 460px; max-width: 500px; overflow: hidden", data_id = Model.YogaSpaceId, data_url = Url.Action("UpdateSummary", "ManageSpaces") })
@Html.ValidationMessageFor(model => model.OverviewSummary, "", new { @class = "text-danger", @style = "font-weight: bold;" })
</form>
</div>



<textarea name="OverviewSummary" class="form-control input-lg valid" id="OverviewSummary" aria-invalid="false" aria-describedby="OverviewSummary-error" style="height: 90px; overflow: hidden; min-height: 64px; max-height: 460px; max-width: 500px;" rows="2" cols="20" data-val="true" data-id="3" data-val-maxlength-max="1500" data-val-maxlength="Maximum Length 1500 Characters." data-url="/ManageSpaces/3/UpdateSummary">This is at Alamo Square Park near Hayes Valley. The cat jumped over the roof to get the mouse.
I like trees!
When I jump its high!
</textarea>

这里是文本区域

enter image description here

这是我按几次回车后的文本区域(没有调整大小!)

enter image description here

最佳答案

糟糕!我注意到我在调整文本区域大小的其他页面上有这个

$('textarea').on('input', function () {
$(this).outerHeight(20).outerHeight(this.scrollHeight);
});
$('textarea').trigger('input');

关于html - 文本区域不随回车调整大小或扩展,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36052287/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com