Skip to content

Commit

Permalink
Use nodeName of event.target for preventDefault
Browse files Browse the repository at this point in the history
instead of checking the nodeName of the Interactable's element
  • Loading branch information
taye committed May 16, 2015
1 parent 6913959 commit 1984c80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion interact.js
Original file line number Diff line number Diff line change
Expand Up @@ -3093,7 +3093,7 @@
var options = interactable.options,
prevent = options.preventDefault;

if (prevent === 'auto' && element && !/^(input|select|textarea)$/i.test(element.nodeName)) {
if (prevent === 'auto' && element && !/^(input|select|textarea)$/i.test(event.target.nodeName)) {
// do not preventDefault on pointerdown if the prepared action is a drag
// and dragging can only start from a certain direction - this allows
// a touch to pan the viewport if a drag isn't in the right direction
Expand Down

0 comments on commit 1984c80

Please sign in to comment.