Problems with inputs and textareas inside of draggable component
See original GitHub issueI investigate some problems when placing <input>
and <textarea>
elements inside of draggable component,
cmd+A
orCtrl+A
shortcuts doesn’t work for input or textarea (but selecting text withShift + Arrows
still works)- Attempt to select input or textarea content with touchpad/mouse starts dragging parent element
My draggable component looks like,
Issue Analytics
- State:
- Created 8 years ago
- Comments:22 (7 by maintainers)
Top Results From Across the Web
1189486 - draggable element interferes with input elements
I am trying to select the text with the mouse by either double click on word or drag through text. For instance: <div...
Read more >Can inputs and textareas be draggable? - Stack Overflow
MDN confirms that draggable is a global attribute (i.e. can be applied to any element), but has the following usage note:.
Read more >How to Use Text Areas (The Java™ Tutorials > Creating a GUI ...
Demonstrates built-in drag-and-drop functionality of several Swing components, including text areas. FocusConceptsDemo · How to Use the Focus Subsystem ...
Read more >HTML Drag and Drop API - W3Schools
In HTML, any element can be dragged and dropped. Example. W3Schools. Drag the W3Schools image into the rectangle. Drag and Drop. Drag and...
Read more >Textarea - Lightning Design System
Textarea inputs are used for freeform data entry. * Textarea Label. About Textarea#. You can style the HTML <textarea> element to align with...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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: