无法在IE上输入框中选择文字 [英] Can't select text in input box on IE
问题描述
< div class ='my_container'>
< input type ='text'name ='my_text_input'class ='my_input'/>
< / div>
任何见解将不胜感激。
我想添加一些更多的信息,我将Dojo dnd Target附加到外部div。如果我不附加dnd,那么我可以做选择,一旦我附加了dnd,我不能再选择文本了。
一旦挖掘了由dojo执行的代码,这似乎是一个很直接的一步!!!
在传递给dojo.dnd.Target构造函数的对象中,需要将skipForm属性设置为true。
所以,它看起来像这样:
var dndTarget = new dojo.dnd.Target(searchBox,{
isSource :false,
copyOnly:true,
selfCopy:false,
selfAccept:false,
skipForm:true //< - 这是FIX
}) ;
这似乎告诉dojo不要连接到输入元素,因此在IE中按预期工作。
I have an input box that is inside of a div, the div has a background image and the input box inside of it is positioned and limited in size / font to work nicely with the background image. In FF everything works as expected, in IE though there is a major issue. I can't select the text inside of the input box using the mouse or use short-cuts like shift-end/home, ctrl-left/right. You can move around using the mouse keys and use the delete/backspace keys to adjust the text. The HTML looks something like this:
<div class='my_container'>
<input type='text' name='my_text_input' class='my_input' />
</div>
Any insight would be greatly appreciated.
I would like to add some more information, i'm attaching a Dojo dnd Target to the outside div. If I don't attach the dnd then I can do the selection, once i've attached the dnd, i can't select the text anymore.
It seems that this is rather straight forward once one digs through the code being executed by dojo!!!
In the object being passed to the dojo.dnd.Target constructor, one needs to set the skipForm attribute to true.
so, it looks something like this:
var dndTarget = new dojo.dnd.Target(searchBox, {
isSource: false,
copyOnly: true,
selfCopy: false,
selfAccept: false,
skipForm: true // <-- THIS IS THE FIX
});
This seems to tell dojo not to connect to the input elements and thus works as expected in IE.
这篇关于无法在IE上输入框中选择文字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!