Closed
Bug 691796
Opened 13 years ago
Closed 3 years ago
the dragstart event is not fired on a svg element
Categories
(Core :: DOM: Copy & Paste and Drag & Drop, defect, P5)
Tracking
()
RESOLVED
INVALID
People
(Reporter: cricri.bug, Unassigned)
References
Details
Attachments
(1 file)
1.19 KB,
text/html
|
Details |
Load the file, try to drag the yellow rectangle, nothing will happen If you click first on the yellow rectangle, then you will be able to drag it; click on the blue container, you will have to click the yellow rectangle another time to start a drag
Reporter | ||
Comment 1•13 years ago
|
||
Updated•13 years ago
|
Attachment #564577 -
Attachment mime type: text/plain → text/html
Comment 2•13 years ago
|
||
try adding container.setAttribute("pointer-events", "none"); draggable.setAttribute("pointer-events", "all");
Reporter | ||
Comment 3•13 years ago
|
||
same bug for the first drag, then works fine (when clicking on the container, the draggable element won't loose the "focus") but the container may have to respond to events...
Comment 4•13 years ago
|
||
I think you're getting some default behaviour from some other event. Maybe mousemove, onclick or onfocus. You may need to add a handler for one or more of these and do event.preventDefault() on them. I don't think there's any real bug here. The browser is allowed to provide default handling for many events and your drag/drop isn't working with that default behaviour.
Comment 5•13 years ago
|
||
See bug 525591 for an alternative drag/drop solution too.
Reporter | ||
Comment 6•13 years ago
|
||
I have tried various combinaison of handlers, but unsuccessfully. Is there a way to know all the events fired by the browser ? I will use the drag&drop old style... Thanks for your help!
Comment 7•13 years ago
|
||
There's no single source that I know of.
Updated•13 years ago
|
Component: General → Drag and Drop
Product: Firefox → Core
QA Contact: general → drag-drop
Target Milestone: Firefox 7 → ---
Comment 8•13 years ago
|
||
We only fire dragstart on selections (text, images or links), html and xul elements. I don't know if the svg spec or some other spec defines drag and drop events in svg. We could support the draggable or similar attribute on svg elements. Or just fire dragstart on all svg elements anyway (as we do for xul). The issue with this approach is that the user action for dragging is the same as for selecting, so if it's expected that dragging with the mouse creates a selection in svg then this approach might not work.
Comment 9•13 years ago
|
||
The SVG spec does not list drag events as being fired on SVG elements: http://www.w3.org/TR/SVG/svgdom.html#RelationshipWithDOM2Events I suspect that's because the SVG specification came before drag events were thought of though. The mouse should work in SVG the same as it does in html.
Comment 10•3 years ago
|
||
Bulk-downgrade of unassigned, untouched DOM/Storage bug's priority.
If you have reason to believe, this is wrong, please write a comment and ni :jstutte.
Severity: normal → S4
Priority: -- → P5
Comment 11•3 years ago
|
||
According to the specification draggable applies to HTML elements only https://html.spec.whatwg.org/multipage/dnd.html#dom-draggable
Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•