React-dnd: Unable to click within an input in IE

Created on 23 May 2016  ·  9Comments  ·  Source: react-dnd/react-dnd

Thanks for such a hard work!

When there is some text in an input box, users aren't able to click within a text box to make edits, they need to delete from the end. I could reproduce it in IE 9 and 10.

Also, for Win10 - Internet Explorer 11, I cannot focus inputs on the first click, but double-clicking works. Check the gif:

dnd

Im using your simple example with added inputs

browser bug bug wontfix

Most helpful comment

I'm using workaround:

<input ... onMouseDown={ (e) => e.target.focus(); }/>

tested in IE11

All 9 comments

I don't have a windows computer so this is going to be a challenge to debug :/

@kesne thanks for your response :) Yeah, I gave it a try but i dont have a windows machine either... it's a very tricky bug, but i dont know whether it's an event error on IE or IE rendering... anyway, im not sure how to debug this properly 😞

@kesne hey! would you have any insights of a way to debug it and where to find this bug? Unfortunately, I dont think im skilled enough for doing so, so if you can sort of tell me how to debug and fix this i could give it a try.

I believe I am experiencing a similar issue for input boxes which are children of a draggable component. It is necessary to double click to get a cursor in any of these input boxes in IE11 or Edge. Also makes it impossible to click and drag to select text in the input boxes.

This is a known bug in IE10, IE11 and Edge and was reported to MS in 2014 but it seems that MS does not want/is not able to fix it: https://connect.microsoft.com/IE/feedback/details/927470/ie-11-input-field-of-type-text-does-not-respond-to-mouse-clicks-when-ancestor-node-has-draggable-true and https://stackoverflow.com/a/27160905

I was able to get around this by only connecting the drag source when not hovering the input.

  render() {
    const content = (
      <div>
        <input
           ...restOfProps
           onMouseOver={ () => this.setState({ dragSourceEnabled: false }); }
           onMouseOut={ () => this.setState({ dragSourceEnabled: true }); }
        />
      </div>
    );

    return this.state.dragSourceEnabled ? this.props.connectDragSource(content) : content;
  }

Are there any other ways of resolving this?
How is the state of this issue?

I'm using workaround:

<input ... onMouseDown={ (e) => e.target.focus(); }/>

tested in IE11

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings