textarea中的插入符不会自动传递新行(仅在chrome中) [英] Caret in textarea doesn't automatically pass new line (only in chrome)

查看:87
本文介绍了textarea中的插入符不会自动传递新行(仅在chrome中)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 < textarea cols =152rows =5> 

之后继续按下空格键,您会注意到脱字符不会传递新的
行并保持放置状态,现在开始推送空格键
textarea的>

当我在现在开始推送空格键后继续按空格键时,插入符号不会自动在行的最后传递到新行。我怎样才能将字尾自动传递到行的最后一行?有没有任何的CSS解决方案? Chrome浏览器(以及许多应用程序)的光标不会跳转到下一个直到你输入一个非空格字符(所以空格不会将它放在一行中)。如果您在键入足够的空格以将光标一直移动到右边缘之后观察,请输入任何其他字符(数字,字母或标点符号),您将下拉一行。这只是Chrome处理textareas的方式,并且是不可配置的。



在一个不相关的说明中,^是一个插入符。


<textarea cols="152" rows="5">
Keep pushing space key after
the end of this sentence, you will notice that caret wouldn't pass new
row and stay put, start pushing space key now
</textarea>

When i just keep pushing space key after "start pushing space key now", caret doesn't automatically passes to new line at the very end of line. How can i get caret pass to new row at the end of row automatically? Is there any css solution for that? And only Chrome has this problem.

解决方案

In Chrome (and a number of applications) the cursor won't jump to the next line until you enter a non-"whitespace" character (so spaces will never drop it down a line). If you observe after keying in enough spaces to move the cursor all the way to the right edge, typing any other character (a number, letter, or punctuation), you will drop down a line. This is simply the way chrome handles textareas, and is not configurable.

On an unrelated note, "^" is a caret.

这篇关于textarea中的插入符不会自动传递新行(仅在chrome中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆