react-dnd: Problems with inputs and textareas inside of draggable component
I investigate some problems when placing <input> and <textarea> elements inside of draggable component,
cmd+AorCtrl+Ashortcuts doesn’t work for input or textarea (but selecting text withShift + Arrowsstill works)- Attempt to select input or textarea content with touchpad/mouse starts dragging parent element
My draggable component looks like,

About this issue
- Original URL
- State: closed
- Created 11 years ago
- Comments: 24 (7 by maintainers)
Commits related to this issue
- Fix #1326 Safari can't focus with draggable parent Summary: **Summary** DraftEditors that lived inside draggable parents were useless in Safari. Now they work. Solution found here: https://github.co... — committed to facebookarchive/draft-js by mattkrick 9 years ago
- Fix #1326 Safari can't focus with draggable parent Summary: **Summary** DraftEditors that lived inside draggable parents were useless in Safari. Now they work. Solution found here: https://github.co... — committed to midas19910709/draft-js by midas19910709 9 years ago
- Fix #1326 Safari can't focus with draggable parent Summary: **Summary** DraftEditors that lived inside draggable parents were useless in Safari. Now they work. Solution found here: https://github.co... — committed to alicayan008/draft-js by mattkrick 9 years ago
- Fix #1326 Safari can't focus with draggable parent Summary: **Summary** DraftEditors that lived inside draggable parents were useless in Safari. Now they work. Solution found here: https://github.co... — committed to aforismesen/draft-js by aforismesen 9 years ago
@rahul1995 - I just found out a solution: just store a ref to the draggable DOM node and when user focuses input/textarea set draggable attribute to
false:This should do the trick for Firefox 😉
Elements with contentEditable set inside a draggable parent container wouldn’t allow me to select text or interact with them in any way. After some digging, I found this bug report: https://bugs.chromium.org/p/chromium/issues/detail?id=170139
It appears Chrome has since fixed the issue. Safari’s behavior can be fixed in the meantime with CSS:
This is not documented very well, but if you add the class name
nodragthis works to not allow dragging by the text input field, meaning you can select and highlight text with your cursor.No other solutions solved my issue.
@trevorsmith This is still not fixing the Firefox’s behaviour. Do you know any workaround for Firefox?