maxGraph / maxGraph

maxGraph is a fully client side JavaScript diagramming library
https://maxgraph.github.io/maxGraph/
Apache License 2.0
799 stars 170 forks source link

makeDraggable : fourth argument is not optional #195

Closed a-rostami closed 1 year ago

a-rostami commented 1 year ago

Hi, There is a problem in makeDraggable function of gestureUtils, the fourth argument of the function is not optoinal but in the docs it says that: @param dragElement Optional DOM node to be used for the drag preview.

also in this storybooks example there are only three arguments when calling the make draggable : DynamicToolbar

tbouffard commented 1 year ago

Hi, thanks for filling this issue. This seems correct according to the implementation: https://github.com/maxGraph/maxGraph/blob/v0.2.0/packages/core/src/util/gestureUtils.ts#L128-L131 The parameter declaration should be dragElement: Element | null = null, instead of dragElement: Element,.

Feel free to submit a Pull Request to fix the signature of the makeDraggable function.