yansern / vue-multipane

Resizable split panes for Vue.js.
https://yansern.github.io/vue-multipane/
Other
588 stars 125 forks source link

Error occur when clicking svg tags #38

Closed suntt2019 closed 2 years ago

suntt2019 commented 2 years ago

The error output is:

TypeError: resizer.className.match is not a function
   at VueComponent.onMouseDown (multipane.js?77e5:41)

The error happens in this line:https://github.com/yansern/vue-multipane/blob/d9a17be799de24af521b3c101dc6277af08503b1/src/multipane.js#L40

The resizer.className here is expected to be a string, however, when click a svg tag, the classname returned is a SVGAnimatedString object. SVGAnimatedString objects don't implement the match method, so a error is thrown.

To fix this bug, a simple way is changing resizer.className into (resizer.className + ""), this will turn the SVGAnimatedString objects into null, and no error occurs in my environment.

suntt2019 commented 2 years ago

Sorry, duplicate issue here, please refer to #6, #19.