oi.select icon indicating copy to clipboard operation
oi.select copied to clipboard

Problem with version 0.2.17 and newer with empty select

Open Hypocrite opened this issue 8 years ago • 4 comments

We updated oi.select from version 0.2.16 to version 0.2.20 and after that the select element does not work correctly anymore.

The select element does not load old values from the ng-model correctly. It remains empty until you add one new element. Then it also displays old elements from the ng-model.

It also does not seem to recognize the track by value correctly because when you for example add track by item.id as the value it allows you to add two different elements with the same id.

I tried with different version of oi.select and it seems that the breakage happened in 0.2.17 because updating to that version breaks it. I tested all version from 0.2.17 to 0.2.20 and all have the same problem.

Hypocrite avatar Apr 26 '16 06:04 Hypocrite

It is a little bit difficult to understanding without example. What options do you use? It is about this feature?

tamtakoe avatar May 10 '16 19:05 tamtakoe

I basically have an edit page which is getting data from the database. When I get the data and bind it to ng-model for editing, the select box does not display the values but is empty.

But once I add a new value from the options, it displays that correctly but also shows the old values which should have already been in the select box.

Also I am using track by to recognize correct value but its not working correctly because if there is a value with same id in the current value binded to ng-model it still allows me to add another option with same tracked value.

I tested different versions and 0.2.16 works without problems with my data but versions after that don't.

I can try to reproduce this with a plunker.

Hypocrite avatar May 10 '16 19:05 Hypocrite

Here is the plunker: http://plnkr.co/edit/1G0Wcax2l7indUdOthCT?p=preview

This is using the oi.select version 0.2.16 from our development version and it works fine. It shows the Demo team as selected.

But if you comment out the select-tpls.min.js and replace it with //rawgit.com/tamtakoe/oi.select/master/dist/select-tpls.js, it will no longer show the selected team as it should.

Hypocrite avatar May 11 '16 05:05 Hypocrite

do we have any fix for it? I am also facing the same issue.

harshitgupta avatar Aug 19 '16 19:08 harshitgupta