2012-12-19 30 views

回答

1

這個問題被回答了在d3-js google group

撕毀諾塔關鍵是停止傳播。請參閱下面的最後一行代碼:

handleGroup 
     .append("foreignObject") 
     .attr("width", 80) 
     .attr("height", 37) 
     .attr('x', 10) 
     .attr('y', 5) 
     .append("xhtml:body") 
     .attr('xmlns','http://www.w3.org/1999/xhtml') 
     .html("<input type='text' />") 
     .on("mousedown", function() { d3.event.stopPropagation(); });