Selectr icon indicating copy to clipboard operation
Selectr copied to clipboard

Bug found when removing item

Open NitemareReal opened this issue 4 years ago • 0 comments

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

https://github.com/Mobius1/Selectr/blob/3d8964ddb926098527a295aa5102a9a36f2abf91/src/selectr.js#L1919

"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)

NitemareReal avatar Dec 05 '21 11:12 NitemareReal