Skip to content

Commit

Permalink
fix(test): new test wasn't working on some browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
Haprog committed Mar 28, 2019
1 parent 506610e commit 7e80a9b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions test/vaadin-combo-box-light.html
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,21 @@
if (rect.width === 0 || rect.height === 0) {
return;
}
const x = Math.round(rect.x);
const y = Math.round(rect.y);
const x = Math.ceil(rect.x);
const y = Math.ceil(rect.y);
// Get the element which would be targeted, when the user
// tries to click on this position
const target = elementFromPointDeep(x, y, elem.ownerDocument);
let target = elementFromPointDeep(x, y, elem.ownerDocument);
if (!target) {
return;
}

// Check if the found element contains a slot (needed for other browsers than Chrome)
const slot = target.querySelector('slot');
if (slot && slot.assignedNodes({flatten: true}).indexOf(elem) !== -1) {
target = elem;
}

fire('click', target);
}

Expand Down

0 comments on commit 7e80a9b

Please sign in to comment.