vue-multipane icon indicating copy to clipboard operation
vue-multipane copied to clipboard

Bug when pane contains svg

Open maxvanceffer opened this issue 7 years ago • 7 comments
trafficstars

I have highchart inside of pane, and when click on it, there error raised with text: TypeError: t.className.match is not a function

because t is path element and it's className is array, and really array has no function match.

VueComponent.onMouseDown vue-multipane/dist/vue-multipane.esm.js:3:560

maxvanceffer avatar Jul 11 '18 09:07 maxvanceffer

@maxvanceffer I also had this error with svg files. I just add to the "mousedown" event handler with the "stop" modifier

<div class="sort-icon" @mousedown.stop>
   <svg>...</svg>
</div>

ulizko avatar Sep 24 '18 15:09 ulizko

Thx... will try, this hack. But as i see, developers already have a pull request, which fix this error.

maxvanceffer avatar Jan 04 '19 15:01 maxvanceffer

https://github.com/yansern/vue-multipane/pull/6

maxvanceffer avatar Jan 04 '19 15:01 maxvanceffer

Unfortunately it is not always possible to add @mousedown.stop above the svg.

Another solution would be to suppress the error in a component, page or layout file further up the component tree:

errorCaptured(error, vm, info) {
  if (error.message === 't.className.match is not a function') {
    return false // prevent the error from propagating
  }
}

francisashley avatar Aug 14 '21 19:08 francisashley

I have the same problem, and none of the solutions above helped. Any chance to fix this in the future? Thanks!

RobbeR avatar Aug 20 '21 20:08 RobbeR

Having the same issue here. I have another plugin inserting svgs on the page. Error appears when the svgs are clicked.

image
image

EDIT: The solution from #6 pull request worked for me.

lkjimy avatar Sep 04 '21 22:09 lkjimy

阻止冒泡虽然能解决问题,但不太优雅; 所以希望能从根儿上解决,如:if (typeof t.className === 'string' && t.className.match('multipane-resizer'))

wangqh avatar Oct 21 '21 03:10 wangqh