Skip to content

Commit

Permalink
Support d3.drag in testing environments
Browse files Browse the repository at this point in the history
Return early from nodrag if no view is passed.

Fixes #89
  • Loading branch information
penx committed Jan 27, 2023
1 parent c6a7e46 commit bfe249f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/nodrag.js
Expand Up @@ -2,6 +2,9 @@ import {select} from "d3-selection";
import noevent, {nonpassivecapture} from "./noevent.js";

export default function(view) {
if(!view) {
return;
}
var root = view.document.documentElement,
selection = select(view).on("dragstart.drag", noevent, nonpassivecapture);
if ("onselectstart" in root) {
Expand Down

0 comments on commit bfe249f

Please sign in to comment.