I don't know if i should worry about this, i have been making a custom directive which dispatches a click event on a input[type="file"] when a div is clicked, everytime a file is chosen or the file selector dialog is closed the error shows in the console.
directive.js
module.directive("cropper", function(){
return {
restrict: "E",
replace: true,
templateUrl: "components/cropper/cropper-directive.html",
link: link
};
function link(scope, element, attr){
var selector = element[0].querySelector(".cropper-selector");
var input = element[0].querySelector(`input[type="file"]`);
// Trigger file input select when selector detects a click
selector.addEventListener("click", function(evt){
var clickEvent = new MouseEvent("click", {
bubbles: true,
canceable: true
}, false);
input.dispatchEvent(clickEvent);
});
}
});
directive.html
<div class="cropper">
<div class="cropper-image">
<div class="cropper-selector">
<label class="centered">Click or drop an image on this block</label>
<input type="file"></input>
</div>
</div>
<div class="cropper-actions"></div>
</div>
i have searched for solutions but all of the threats i have found are made only on jQuery and as you can see, i am using the native event listeners of Javascript, if this is something i should worry about, i would like to know the solution without using any jQuery method
UPDATE: i've forgot to mention that input has display: none so it would make the component look like a draggable drop files
inputclicked ->cropper-selectoralso clicked?inputhas displaynone, i will update thatinputto a click event, then it also means thatcropper-selectoralso trigger that clicked? this causes recursion