Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with text input inside draggable component (Firefox) #260

Closed
ntdb opened this issue Aug 7, 2015 · 5 comments
Closed

Problems with text input inside draggable component (Firefox) #260

ntdb opened this issue Aug 7, 2015 · 5 comments
Labels

Comments

@ntdb
Copy link

ntdb commented Aug 7, 2015

There are problems with text inputs inside components that have the HTML5 attribute draggable set to true in Firefox (because of this known bug). I'm working on setting draggable to false in an onFocus handler and setting it back to true in an onBlur handler (as recommended here), but react-dnd has no support for such a workaround and the attribute is immediately set back to true.

Given that there doesn't seem to be progress on this bug in FireFox, is there room for a shim in react-dnd to handle this? I'll update this issue if I come up with a good solution regardless.

@ntdb
Copy link
Author

ntdb commented Aug 7, 2015

The root of this might be #256

@ntdb
Copy link
Author

ntdb commented Aug 7, 2015

For now I'm working off of a fork that allows me to manage the draggable attribute directly in my app.

@gaearon
Copy link
Member

gaearon commented Aug 7, 2015

Thanks. I'm currently busy with some other projects.
If any of these PRs help you, let me know too: https://github.com/gaearon/react-dnd/pulls

@gaearon gaearon added the bug label Aug 7, 2015
@gaearon
Copy link
Member

gaearon commented Aug 7, 2015

Please don't forget HTML5 backend is only included as a convenience.
You can publish your fixed version on NPM (it's a single file) but still use the main repo for everything else.

@gaearon
Copy link
Member

gaearon commented Sep 17, 2015

You should be able to work around this bug by toggling a state variable in onFocus and onBlur, and changing your render function to not call connectDragSource() during input:

render() {
  const element = <div><textarea onFocus=... /></div>;
  return this.state.editing ? element : this.props.connectDragSource(element);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants