Mobius1/Selectr

Bug found when removing item

Opened this issue · 0 comments

I found a bug when removing a option, the bug is removing the original option from "this.el":

this.el.remove(option);

"remove" method for HTMLSelectElement expects an index as argument, but the option itself is supplied. This causes the first option to be removed instead of desired option.

Solution is calling this.el.remove(index) or this.el.remove(option.idx)