Skip to content

Commit

Permalink
Fixes #114 | Filter Drag.toElements_ with Element.matches method
Browse files Browse the repository at this point in the history
  • Loading branch information
p2kmgcl authored and diegonvs committed Jan 10, 2019
1 parent 3fcf3ef commit 5f42f9c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/metal-drag-drop/src/Drag.js
Original file line number Diff line number Diff line change
Expand Up @@ -723,10 +723,10 @@ class Drag extends State {
*/
toElements_(elementOrSelector) {
if (core.isString(elementOrSelector)) {
let matched = this.container.querySelectorAll(
`${elementOrSelector}:not([aria-grabbed="true"])`
);
return Array.prototype.slice.call(matched, 0);
const matched = this.container.querySelectorAll(elementOrSelector);
return Array.prototype
.slice.call(matched, 0)
.filter(element => element.matches(':not([aria-grabbed="true"])'));
} else if (elementOrSelector) {
return [elementOrSelector];
} else {
Expand Down

0 comments on commit 5f42f9c

Please sign in to comment.