Impossible to make <button>s draggable
Categories
(Core :: DOM: Copy & Paste and Drag & Drop, defect)
Tracking
()
| Webcompat Priority | P3 |
People
(Reporter: giorgio.liscio, Assigned: edgar)
References
(Blocks 2 open bugs)
Details
(Keywords: webcompat:platform-bug)
User Story
user-impact-score:820 platform-scheduled:2025-11-15
Attachments
(2 files, 1 obsolete file)
Comment 2•9 years ago
|
||
Comment 3•9 years ago
|
||
Comment 4•8 years ago
|
||
Comment 5•8 years ago
|
||
Comment 6•8 years ago
|
||
Comment 7•8 years ago
|
||
Updated•8 years ago
|
Comment 8•7 years ago
|
||
Comment 9•7 years ago
|
||
Comment 10•7 years ago
|
||
Comment 11•7 years ago
|
||
Comment 12•7 years ago
|
||
Updated•6 years ago
|
Updated•6 years ago
|
Comment 13•6 years ago
|
||
Migrating Webcompat whiteboard priorities to project flags. See bug 1547409.
Comment 14•6 years ago
|
||
See bug 1547409. Migrating whiteboard priority tags to program flags.
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Comment 15•5 years ago
|
||
Any updates?
This bug has been open for 10 years and still exists in FF 70.0.1.
Comment 16•5 years ago
|
||
Firefox 74.0.1 on windows:
A button is draggable only if you start dragging from its content. Not draggable if you start from the padding area
If no html content(even if it has css content) => Not draggable at all
Updated•3 years ago
|
Comment 17•3 years ago
|
||
It seems the original testcase provided in comment 1 has to some extent be solved, but the testcase provided in comment 16 shows it's still a problem in other situation.
This is a simplified testcase of the one in comment 16 which shows the problem. All three buttons should be equally draggable in this testcase.
Comment 18•3 years ago
|
||
Lack of draggable support can inhibit the adoption of semantic <button> where they are deserved, and force developers to use role="button" with other elements instead.
Updated•3 years ago
|
Comment 21•6 months ago
|
||
Comment 23•5 months ago
|
||
For others:
A <button> element in firefox itself is not draggable. However, the <button> can itself be dragged from any content within the <button>.
So to work around this issue, ensure that the content of your <button> (eg a span) takes up the full size of the <button>.
- ❌ Cannot drag from
::beforeor::afteron the button - ❌ Cannot drag from padding around text content in a button (<button>content</button>)
- ❌ Cannot drag from the border of the button
- ✅ Can drag the button from content of the button (eg inner text or inner elements)
- 🧑🔧 Workaround: make an inner element take up the full size of the
<button> - ⚖️ Up to you if you want to put the border on the inner element so that users can drag from the border, but I expect keeping the border on the button itself is reasonable for most folks
Workaround example: https://codesandbox.io/p/sandbox/x7x7cy
Comment 24•4 months ago
|
||
Thank you Alex, that's a good workaround.
Updated•3 months ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
| Assignee | ||
Updated•13 days ago
|
| Assignee | ||
Updated•6 days ago
|
| Assignee | ||
Comment 26•4 days ago
|
||
We already support dragging a button when the drag starts from its text content.
Description
•