react-dnd / react-dnd-html5-backend

HTML5 backend for React DnD [Legacy Repo]
MIT License
145 stars 97 forks source link

TextArea inside dragable content not working in IE #13

Closed vavdav closed 8 years ago

vavdav commented 8 years ago

Hello, I have problem with IE, when I want to edit textArea text inside dragable content it does not working.

HTML5Backend.prototype.handleSelectStart = function handleSelectStart(e) {
    // Prevent selection on IE
    // and instead ask it to consider dragging.
    if (typeof e.target.dragDrop === 'function') {
      e.preventDefault();
      e.target.dragDrop();
    }
  };

When I comment this code it is working. Is here some solution to this issue? Thank you

edit: something like this is working, but is it correct way?

HTML5Backend.prototype.handleSelectStart = function handleSelectStart(e) {
    if (e.target.nodeName === 'TEXTAREA') {
      return;
    }
    // Prevent selection on IE
    // and instead ask it to consider dragging.
    if (typeof e.target.dragDrop === 'function') {
      e.preventDefault();
      e.target.dragDrop();
    }
  };

edit: I am trying it with this component: https://github.com/andreypopp/react-textarea-autosize