Unable to select text in input field in IE

I have an input field that is inside a div, the div has a background image, and the input field inside it is located and limited in size / font to work well with the background image. In FF, everything works as expected in IE, although there is a serious problem. I cannot select the text inside the input field with the mouse or use short cuts such as shift-end / home, ctrl-left / right. You can move with the mouse keys and use the delete / backspace keys to adjust the text. HTML looks something like this:

<div class='my_container'>
  <input type='text' name='my_text_input' class='my_input' />
</div>

Any insight would be very helpful.

I would like to add more information, I am attaching the Dojo dnd Target to the outer div. If I don’t attach dnd, then I can make a choice, as soon as I connect dnd, I can no longer select text.

+3
source share
1 answer

This seems to be pretty straight forward as soon as one breaks through the code executed by dojo !!!

In the object passed to the dojo.dnd.Target constructor, you must 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 input elements and therefore works as expected in IE.

0
source

Source: https://habr.com/ru/post/1724552/


All Articles