Open Bug 1036408 Opened 11 years ago Updated 1 year ago

mouseout event fires erroneously when file upload dialog is open

Categories

(Core :: DOM: Events, defect, P5)

33 Branch
x86
macOS
defect

Tracking

()

UNCONFIRMED

People

(Reporter: dean, Unassigned)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36 Steps to reproduce: 1. Go to http://demos.dojotoolkit.org/demos/uploader/demo.html?forceNoFlash 2. Observe the mouseout event on the Select Images button document.getElementById('dojox_form_FileUploader_0').addEventListener('mouseout', function(e) { console.log('mouseout', e) }); 2. Click to select a file to upload 3. Move the mouse over the dialog, or off the page and note that this leads to mouseout being fired Actual results: "mouseout" is fired when the cursor moves over the file input dialog, or off the page. I opened a chromium bug for this: https://code.google.com/p/chromium/issues/detail?id=392256 They pointed out this behavior exists in mac/firefox too. Safari demonstrates the expected behavior, as well as firefox and chrome on windows. This leads to an early cancellation of dojox's FileUploader widget, leaving it in a bad state. Without an API for determining when the dialog is open or cancelled the timing of this mouseout event is the only clue. Expected results: "mouseout" shouldn't fire until the dialog is closed.
(In reply to dean from comment #0) > User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) > AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36 > > Steps to reproduce: > > 1. Go to http://demos.dojotoolkit.org/demos/uploader/demo.html?forceNoFlash > 2. Observe the mouseout event on the Select Images button > > document.getElementById('dojox_form_FileUploader_0'). > addEventListener('mouseout', function(e) { console.log('mouseout', e) }); > 2. Click to select a file to upload > 3. Move the mouse over the dialog, or off the page and note that this leads > to mouseout being fired > > > Actual results: > > "mouseout" is fired when the cursor moves over the file input dialog, or off > the page. It's not clear to me why this is not the expected behaviour in your eyes. > This leads to an early cancellation of dojox's FileUploader widget, leaving > it in a bad state. Without an API for determining when the dialog is open or > cancelled the timing of this mouseout event is the only clue. The "change" event will fire if you close the dialog, unless the user doesn't select anything. Why do you need to know when the dialog is cancelled?
Flags: needinfo?(dean)
(In reply to :Gijs Kruitbosch from comment #1) > It's not clear to me why this is not the expected behaviour in your eyes. I would otherwise expect "mouseout" to fire when the pointer exits the node, just as it would when there's no file upload dialog open. The fact that mouseout is deferred at all suggests to me that the typical mouseout behavior isn't expected. I can't understand the logic of why it should fire in this particular circumstance, but perhaps I'm not being creative enough. Is there a reason firefox on windows doesn't exhibit the same behavior? I'd considered that it could be os-specific, but safari exhibits the behavior I'd referred to as expected on os x. > The "change" event will fire if you close the dialog, unless the user > doesn't select anything. Why do you need to know when the dialog is > cancelled? We need to know in order to fulfill the `onCancel` hook of the widget's API correctly.
Flags: needinfo?(dean)
Component: Untriaged → DOM: Events
Product: Firefox → Core
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046 Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5. If you have questions, please contact :mdaly.
Priority: -- → P5
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.