unable to select text in input[type="text"][draggable]
Categories
(Core :: DOM: Copy & Paste and Drag & Drop, defect)
Tracking
()
People
(Reporter: flying-sheep, Unassigned, NeedInfo)
References
(Depends on 1 open bug)
Details
Attachments
(1 file, 1 obsolete file)
| Reporter | ||
Comment 1•13 years ago
|
||
| Reporter | ||
Comment 2•13 years ago
|
||
| Reporter | ||
Comment 3•13 years ago
|
||
| Reporter | ||
Comment 5•13 years ago
|
||
Comment 8•11 years ago
|
||
Comment 10•10 years ago
|
||
Updated•10 years ago
|
Comment 11•8 years ago
|
||
Comment 12•8 years ago
|
||
Comment 13•8 years ago
|
||
Comment 14•7 years ago
|
||
This is still present in 65.0.
In my case, I am using Material UI (React). I have a Chip with a label set to a TextField and draggable="true" This works in Chrome.
It seems that there has been interest in a fix for this for years. Please take a look at fix this.
Comment 15•6 years ago
|
||
Still present in 73.
Comment 16•5 years ago
|
||
Able to reproduce in 76
8 years bug, wow
Comment 17•5 years ago
|
||
Reproducible in 84. Please prioritize fixing this bug.
Comment 18•5 years ago
|
||
The latter case should be handled by bug 739071, but I'm not sure whether the first case (Whether <input draggable="true"> should or should not be worked as an <input> element for mouse operation).
This WPT said that it should not be dragged.
https://searchfox.org/mozilla-central/source/testing/web-platform/tests/html/editing/dnd/interactiveelements/006.html
However, both Chrome and Safari works as same as Gecko (except putting caret position).
smaug: WDYT?
Comment 19•5 years ago
|
||
The input itself can only be selectable or draggable, not both. If you add draggable to the input itself, then it is expected to be draggable (no text selection).
The developer would have the option to remove draggable if they want it selectable. For example, let's say I want to time a mouse down event on the input. If it is a long click, then adding "draggable" to the input would allow me to start dragging it around. But on mouse up, I can remove draggable and then select/edit the input text.
As for a draggable parent, if there were three states for the child input, it might be easier:
- draggable="inherit" would drag both the input and the parent together, assuming the parent (or ancestor) is draggable
- draggable would drag the input independently, regardless of the parent.
- (nothing) would let you select text
#2 and #3 are still valid and expected behaviour, even if you can't have #1.
| Comment hidden (metoo) |
Comment 22•3 years ago
|
||
Just came across this. Applied a workaround to only set draggable to true when needed.
<!doctype html>
<div id="outer" style="touch-action : none;">
<div id="drag-handle">
<span>drag me!</span>
</div>
<div>
<input type="text" value="abc">
</div>
</div>
<script>
var outerDiv = document.getElementById("outer");
var dragHandle = document.getElementById("drag-handle");
dragHandle.onmousedown = e => outerDiv.draggable = true;
dragHandle.onmouseup = e => outerDiv.draggable = false;
outerDiv.ondragend = e => outerDiv.draggable = false;
</script>
Updated•3 years ago
|
| Comment hidden (metoo) |
Comment 25•11 months ago
|
||
Masayuki said bug 739071 will take care of the first case, but there's a second case that he wasn't sure. So I'll just leave this open
Description
•