Skip to content

Commit

Permalink
avoid event bugs in Chrome in test code.
Browse files Browse the repository at this point in the history
For unknown reasons, the mouse leave and mouse enter events occur before the click event.
  • Loading branch information
vmi committed Sep 23, 2021
1 parent 6ea32c2 commit d93ae40
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/test/resources/htdocs/issue179_02.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@
$(document).ready(function () {
"use strict";

var enter = function () {
var entered = false;

var enter = function (event) {
"use strict";
if (entered)
return;
entered = true;
console.log("Entering nav item");
$(this).has(".sub").length && (
$(".sub").stop(!0, !0).hide(),
Expand All @@ -19,8 +24,11 @@
$(this).children(".sub").attr("aria-expanded", "true")
)

}, leave = function () {
}, leave = function (event) {
"use strict";
if (!event.relatedTarget && !event.toElement)
return;
entered = false;
console.log("Leaving nav item");
$(".sub").stop(!0, !0).hide(),
$("#nav .wrap > ul > li").removeClass("hover"),
Expand Down

0 comments on commit d93ae40

Please sign in to comment.