Open
Bug 1233955
Opened 9 years ago
Updated 4 years ago
Don't raise mouseover events when ajax content loaded and mouse movement
Categories
(Core :: DOM: Events, defect, P5)
Tracking
()
NEW
People
(Reporter: Sergey.V.Ezhov, Unassigned)
Details
(Keywords: dupeme)
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0
Build ID: 20151216175450
Steps to reproduce:
I can't write English. Russian
Я занимаюсь разработкой веб-приложений, интернет-сайтов.
1. Есть элемент (дерево) для загрузки контента в другой элемент (DIV) с помощью ajax-запроса
2. При выборе одно из элементов в дереве загружается контент в DIV
Actual results:
При загрузке контента в соседний DIV (с помощью jQuery 2) происходит генерация события перемещения мыши внутри элемента, в который был загружен контент, хотя мышь все еще находится на элементе дерева.
mouseenter, mouseleave
Expected results:
Не должно генерироваться событие перемещения мыши, т.к. реально еще нет никаких перемещений внутри данного элемента.
Я проверял с помощью console.log()
В других браузерах (Chrome, Opera) подобное событие не генерируется.
| Reporter | ||
Updated•9 years ago
|
OS: Unspecified → Windows 7
Hardware: Unspecified → x86_64
Can you provide an example?
Component: Untriaged → DOM: Events
Flags: needinfo?(Sergey.V.Ezhov)
Product: Firefox → Core
Summary: Rised mouse event move within ajax-loaded content → Don't raise mouse events on ajax content loaded
Keywords: testcase-wanted
| Reporter | ||
Comment 2•9 years ago
|
||
(In reply to YF (Yang) from comment #1)
> Can you provide an example?
http://landok.inet777.pro/admin
login: test
password: test
Menu: 'Контент'
Just switch between 'List 1' and 'List 2'
and see in console log window in browser
Move mouse in the lists - events are generated. It right! But only switching 'List 1' and 'List 2' generated in FireFox mouse events too. In Chrome - not.
Compare logs in FireFox and Chrome
in list JS code:
<script type="text/javascript">
<!--
//<![CDATA[
if (typeof jQuery !== 'undefined') {
$(document).ready(function () {
console.log('List loaded by ajax');
$('table.list').on('mouseenter', 'tr', function(e) {
console.log('Event in list');
console.log(e);
});
});
}
//]]>
//-->
</script>
Flags: needinfo?(Sergey.V.Ezhov)
Keywords: testcase-wanted
| Reporter | ||
Comment 3•9 years ago
|
||
(In reply to YF (Yang) from comment #1)
> Can you provide an example?
You verify it?
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 7 → Windows
Hardware: x86_64 → All
Summary: Don't raise mouse events on ajax content loaded → Don't raise mouseenter event when ajax content loaded
Whiteboard: [DUPEME]
| Reporter | ||
Comment 4•9 years ago
|
||
Why only mouseenter?
I noticed this because tr:hover is happen (background color changed, and link within is active), then mouseleave probably rised, beacause tr, link becomes in normal state.
| Reporter | ||
Comment 5•9 years ago
|
||
Change script:
<script type="text/javascript">
<!--
//<![CDATA[
if (typeof jQuery !== 'undefined') {
$(document).ready(function () {
console.log('List loaded by ajax');
$('table.list').on('mouseenter', 'tr', function(e) {
console.log('Event enter in list');
console.log(e);
});
$('table.list').on('mouseleave', 'tr', function(e) {
console.log('Event leave in list');
console.log(e);
});
});
}
//]]>
//-->
</script>
Raised BOTH events. It only catched event... may be other raised too?
Before I did not see an mouseleave event log, so I did not confirm it. I guess it is not a necessary condition for reproduce and resolve the issue.
This testcase may require further confirmation and unraveling by expert, not me.
I seen the type:mouseover and type:mouseout in events details.
Summary: Don't raise mouseenter event when ajax content loaded → Don't raise mouseover events when ajax content loaded and mouse movement
| Reporter | ||
Comment 7•9 years ago
|
||
I verify one more moment.
This mouse events are catched by JQuery 2, but with jQuery 1 - not.
| Reporter | ||
Comment 8•9 years ago
|
||
(In reply to Sega100500 from comment #7)
> I verify one more moment.
> This mouse events are catched by JQuery 2, but with jQuery 1 - not.
No. In jQuery 1 happends too. I'm sorry.
Comment 9•9 years ago
|
||
Does anyone have a minimal testcase for this? Hopefully without jQuery since I'm sure it has browser specific code paths, but even a minimal testcase with jQuery (attached to this bug if possible) would be useful.
| Reporter | ||
Comment 10•9 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #9)
> Does anyone have a minimal testcase for this? Hopefully without jQuery since
> I'm sure it has browser specific code paths, but even a minimal testcase
> with jQuery (attached to this bug if possible) would be useful.
jQuery in this case used for check for event occure. I see it when tr:hover activate and deactivate ("blink") without mouse move over tr.
| Reporter | ||
Comment 11•9 years ago
|
||
I add 'List 3'. Switching between 'List 2' and 'List 3' is more more representative demonstration - can see moments when background of tr changed without inspecting console log.
| Reporter | ||
Comment 12•9 years ago
|
||
With turned on of FireBug or Inspector it is more noticeable.
And by clicking on one element ('List 2' and 'List 3') many times (not switching) it is more noticeable.
| Reporter | ||
Comment 13•9 years ago
|
||
The fact is that its events happens in FireFox only.
I verify Chrome, Opera, Internet Explorer - none of them are not happening.
Comment 14•4 years ago
|
||
Bulk-downgrade of unassigned, 4 years untouched DOM/Storage bugs' priority.
If you have reason to believe this is wrong (especially for the severity), please write a comment and ni :jstutte.
Severity: normal → S4
Priority: -- → P5
You need to log in
before you can comment on or make changes to this bug.
Description
•