Closed
Bug 626397
Opened 14 years ago
Closed 14 years ago
SVG onmousedown/onmousemove dragging text instead of "use" element
Categories
(Firefox :: General, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: gbe8086, Unassigned)
Details
Attachments
(1 file)
|
2.83 KB,
image/svg+xml
|
Details |
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:2.0b9) Gecko/20100101 Firefox/4.0b9
Build Identifier: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:2.0b9) Gecko/20100101 Firefox/4.0b9
Sometimes after select and dragging the TEXT in the box, the box moves
BUT sometimes select and drag on the TEXT, gives a small box outline, which
looks like a text selection drag highlight, is dragged, and the box doesn't
move until the text highlight is released, when the box suddently moves to
be under the mouse cursor.
This later behaviour suggests that the mouse-down and mouse-move events are
arriving at the javascript after drag release.
Reproducible: Sometimes
Steps to Reproduce:
1. Load the attached SVG+JavaScript
2. Select the text (e.g. letter 'e') and drag
3. either box moves immediately, or a text selection moves with the cursor, and box moves when the mouse button is released.
Actual Results:
click down on the text (e.g. letter 'e') and drag
either box moves (what I want) or text selction moves, then box moves on mouse button up
Expected Results:
clicking down should allow box and its text to be dragged
This is also a bug in Firefox 4b8
This is not a bug on Safari 5.0.3, or Opera 11.00
I am willing to believe I have made a programming error, and there is an alternative approach, but this is very close to published solutions
(sadly, Firefox 4b9 has just broken, and I can't use a bookmark to give a reference, I'll try again later :-(
Bookmarks work again
The examples I looked are are:
http://www.codedread.com/blog/archives/2005/12/21/how-to-enable-dragging-in-svg/
and
http://www.codedread.com/dragtest2.svg
Comment 3•14 years ago
|
||
Does adding evt.preventDefault() to any/all of the methods fix it?
Yes!
I added evt.preventDefault() to the onmousedown event handler, and *ONLY* that event handler, and the text drag selection highlight seems to stop happening.
I realise you are likely busy, but if you get time, maybe you would suggest what I could read/look at to understand why this works?
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Comment 5•14 years ago
|
||
We didn't fix anything, you did so this can't be "FIXED"
Bug 356295, "Implement HTML5 drag-drop API" seems like the most likely candidate for having caused this change in behavior.
After Bug 356295 landed, events started being handled by the higher level drag-drop API. So this "bug" is just a case where the testcase's event-handler needs to prevent the event from bubbling up.
Resolution: FIXED → INVALID
Comment 6•14 years ago
|
||
(In reply to comment #4)
> I realise you are likely busy, but if you get time, maybe you would suggest
> what I could read/look at to understand why this works?
https://bugzilla.mozilla.org/show_bug.cgi?id=525591#c20 gives some details.
You need to log in
before you can comment on or make changes to this bug.
Description
•