Chrome Crashing with whitespaces in Textarea on using onClic

Chrome Crashing with whitespaces in Textarea on using onClick="this.select();"

本文关键字:on using onClic Textarea in Crashing with whitespaces Chrome      更新时间:2023-09-26

我使用的是Chrome版本38.0.2125.104(64位)。这是崩溃与空白的文本区域在这个。选择()。

<style>
.custom-input {
font-size: 12px;
width: 100%;
color: #555555;
}
.parent-div {
white-space: nowrap;
}
.child-div textarea {
white-space: inherit;
}
</style>
<div class="parent-div">
<div class="child-div">

<textarea class="md-input ng-binding" type="text" readonly="" onclick="this.select();"          rows="4">                          &lt;img       src="http://www.nikhilmaheshwari.in"
                      alt="ITs my homepage, see http://www.nikhilmaheshwari.in" height="1" width="1" /&gt;
                    </textarea>
 </div>
</div>

检查JS Fiddlehttp://jsfiddle.net/nikdtu/vqfefjwo/

我知道有几个解决办法,但我很想知道原因。请建议你是否可以分享可能的原因。

编辑:它使用"white-space:pre-line;"或"white-sespace:pre;"或"white-sspace:pre-wrap;",但不使用"white-sepace:nowrap

textarea标签中移除内部空间

<textarea class="custom-input ng-binding" type="text" readonly="" onclick="this.select()" rows="4">&lt;img src="http://www.nikhilmaheshwari.in" alt="Its my homepage !, see preview @  http://www.nikhilmaheshwari.in" height="1" width="1" /&gt;</textarea>

它对我来说很好。