0👍
Use only css as pointer-events: none;
function func(){
console.log("clicked");
}
#myCanvas{
border: 1px solid #000000;
pointer-events: none;
}
#myCanvas2{
border: 1px solid #000000;
}
<h2>With Css try to click me..</h2>
<canvas id="myCanvas" width="200" height="100" onclick="func()">
</canvas>
<h2>Without Css try to click me..</h2>
<canvas id="myCanvas2" width="200" height="100" onclick="func()">
</canvas>
- [Vuejs]-How to push to a specific array item in the vuex state
- [Vuejs]-How to handle nested arrays with a v-for
0👍
Add in the css property pointer-events: none
- [Vuejs]-Requests and internet access is blocked in my Vue.js – Cordova App on IOS13
- [Vuejs]-Vue constructor not having local state
0👍
If it’s only Construct2 problem I would say add condition to every on click event that checks if the cursor is NOT over HTML element to activate canvas events, and not activate if it is. Since I’m not quite sure where the problem occurs I’ll leave it at that, hope it helps!
- [Vuejs]-Unable to add a chart to my vue component
- [Vuejs]-Select is not populating via API call in VueJS
Source:stackexchange.com