Open
Bug 294844
Opened 20 years ago
Updated 2 years ago
Html elements can still be dragged when mouse is outside the window
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Tracking
()
REOPENED
People
(Reporter: martijn.martijn, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: testcase)
Attachments
(1 file)
|
1.07 KB,
text/html
|
Details |
See upcoming testcase. Afaik, you should not be able to interact with the content area, when the mouse is outside the window. So the draggable div in this testcase should not be dragging on when the mouse is moved outside the content area. This only happens when there is at least some text in the draggable div, with no text at all, the bug doesn't happen.
| Reporter | ||
Comment 1•20 years ago
|
||
Comment 2•19 years ago
|
||
FYI: Adding "-moz-user-select: none;" to the style for #sun fixes the problem.
Comment 3•18 years ago
|
||
I believe this is the correct behavior, and certainly it's what I want. When the mouse is pressed, mouse capture is engaged so that you can get mousemove and mouseup events that occur outside the window. Once the mouseup occurs, mouse capture is turned off. If this didn't happen then DHTML dragging scripts don't get the mouseup to end the drag if the mouse is released when the cursor is outside the window. This can cause all sorts of strange behavior.
Comment 4•18 years ago
|
||
It may be what you want, until you try to implement a cross-frame drag and drop application. ;)
| Reporter | ||
Comment 5•18 years ago
|
||
Yeah, there are probably scenarios where this is desired, but I think it would be better if it would happen in a controllable way, rather than by accident.
Comment 6•18 years ago
|
||
Frank: yeah, making something unselectable will "fix" this since that causes the function that does the mouse grabbing to return early: http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/layout/generic/nsFrame.cpp&rev=3.667&mark=1781,1785-1786,1792-1793#1776 Note that capturing mouse events from outside the window is not necessarily the same thing as capturing events from outside a frame. I wonder if I would be happy if mouse events that occur outside the window caused an equivalent DOM event to be dispatched to the top level content document with the document object as the event's target, regardless of whether the capture-activating mousedown occurred in a subframe or not. Martijn: I agree it would be nice if this was more controllable. I doubt it is possible to have this behavior happen automatically and still allow everyone to meet their use cases. Do you have any suggestions on how this might be done?
Updated•15 years ago
|
Assignee: events → nobody
QA Contact: ian → events
| Reporter | ||
Updated•8 years ago
|
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WORKSFORME
Updated•8 years ago
|
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
| Assignee | ||
Updated•6 years ago
|
Component: Event Handling → User events and focus handling
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•