Mobius1/Selectr

TypeError: "this.el.form is null"

Opened this issue · 0 comments

I am using your great component for months and I thought this error was from my code (VueJS application), but in fact I just discovered that there is an error in the minification of your code...

When I am in the source file, I can see that the this.el.form.removeEventListener("reset",this.events.reset) is into an if statement that check if this.el.form is not null ... BUT in the minified file, there is no such if statement, so i add it myself and the error disappeared... I don't know what is it going between the source file and the minified file but that was turning me crazy. :)

So I replaced
this.on("selectr.destroy",function(){this.el.form.removeEventListener("reset",this.events.reset)}))};
by
this.on("selectr.destroy",function(){if(this.el.form!=null){this.el.form.removeEventListener("reset",this.events.reset)}}))};