输入在Internet Explorer 8中的textarea中不起作用 [英] enter does not work in textarea in Internet Explorer 8

查看:122
本文介绍了输入在Internet Explorer 8中的textarea中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在一个textarea中按enter键,其中的whitespace属性通过css设置为nowrap,它是无效的。不创建新行。 Instread出现一个简单的空格。
这在IE8中是唯一的。我试过最新版本的Opera,Chrome和Firefox,我没有遇到这样的问题。



我有这个: / p>

  .gwt-TextArea 
{
white-space:nowrap;
}

其中gwt-TextArea设置textarea。



此外,我尝试过

  .gwt-TextArea 
{
white -space:pre;
}

似乎给出相同的结果。

解决方案

因此,不幸的是,这个解决方案是 - 对于Internet Explorer 7,任何白色空间 pre 会导致此问题。
对于Internet Explorer 8,任何白色空间 pre-wrap 以外的值会导致此问题。



我没有尝试过Internet Explorer 9。
如果这种情况发生,只需创建一个空白页(一个doctype和)< textarea> ,打开它,然后按F12。在控制台(脚本选项卡)中,键入 console.log(document.getElementsByTagName(TEXTAREA)[0] .currentStyle.whiteSpace)作为< textarea> white-space 属性的值显示在输出中。 >

更新



我试过Internet Explorer 11.从Internet Explorer 7模式以来的仿真模式,它的行为像Chrome在怪异模式(意思是,只有白空间:正常白空间:nowrap 问题)。
我猜他们(无意的?)backported一些修复大多数的仿真模式。


When I press enter in a textarea which has whitespace attribute is set to nowrap through css, it is ineffective. No new line is created. Instread a simple whitespace appears. This is only true in IE8. I Have tried current version of Opera,Chrome and Firefox and I have not encountered such problems. Do you have some solution for this?

Thanks..

I have this:

.gwt-TextArea
{
white-space:nowrap;
}

where gwt-TextArea sets the textarea.

Also, I have tried

.gwt-TextArea
    {
    white-space:pre;
    }

It seems to give the same result.

解决方案

So, the solution is, unfortunately, this -
For Internet Explorer 7, any white-space value other than pre will cause this issue.
For Internet Explorer 8, any white-space value other than pre-wrap will cause this issue.

I have not tried Internet Explorer 9, though.
In case this is happening there as well, just create a blank page with (a doctype and) a <textarea>, open it and press F12. In the console ("Scripts" tab), type console.log(document.getElementsByTagName("TEXTAREA")[0].currentStyle.whiteSpace) and simply use the value that is displayed within the output as the value of the white-space property of the <textarea>.

Update

I tried Internet Explorer 11. In emulation modes since Internet Explorer 7 mode, it behaves like Chrome in quirks mode (meaning, only white-space: normal and white-space: nowrap cause this issue). I guess they (unintentionally?) backported some fix to most of the emulation modes.

这篇关于输入在Internet Explorer 8中的textarea中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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