简体   繁体   English

使用onClick =“” this.select();“导致Chrome在Textarea中出现空格崩溃

[英]Chrome Crashing with whitespaces in Textarea on using onClick=“this.select();”

i am using Chrome Version 38.0.2125.104 (64-bit). 我使用铬版38.0.2125.104(64位)。 Which is Crashing with whitespaces in Textarea on this.select(). 这在this.select()的Textarea中出现空格崩溃。

<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>

Check JS Fiddle http://jsfiddle.net/nikdtu/vqfefjwo/ 检查JS小提琴http://jsfiddle.net/nikdtu/vqfefjwo/

I know couple of resolutions for it but I am interested in knowing the cause of it. 我知道一些解决方法,但我有兴趣了解其原因。 Please suggest if you can share the probable reason. 请提出您是否可以分享可能的原因。

Edit : its working with "white-space: pre-line;" 编辑:其工作与“空白:前行;” or "white-space: pre;" 或“空白:前置;” or "white-space: pre-wrap;" 或“空白:预包装;” but not working with "white-space: nowrap;" 但不能使用“空白:nowrap;” or "white-space: normal;" 或“空白:正常;” or "white-space: inherit;"(if parent is any of normal or nowrap) 或“空白:继承;”(如果父级是正常或nowrap中的任何一个)

Remove the inner space from textarea tag 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>

Its working fine for me. 它对我来说很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM