Skip to content
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.

ui-lock-choice for multiple select makes items unremovable after unlocking #1878

Closed
Mugi4ok opened this issue Dec 19, 2016 · 8 comments
Closed
Milestone

Comments

@Mugi4ok
Copy link

Mugi4ok commented Dec 19, 2016

Bug description:

While using ui-lock-choice attribute inside ui-select-match for multiple ui-select after I lock and then unlock choices, all choices selected prior to locking become unremovable, clicking on x just does nothing.
This does not affect elements added after locking or all elements before locking ever applied, although repeated lock-unlock action makes them unremovable as well.
Bug reproduces since 0.18.1 till latest version (last working version is 0.17.1 as I tested).

Steps to reproduce:

  1. Select some elements from multiple select box, try removing them - should behave as expected;
  2. Lock choices for this select box; then unlock it;
  3. Try to remove previously added elements - elements are not removed;

Link to minimally-working plunker that reproduces the issue:

http://plnkr.co/edit/KvDDll8h2wZg7JUJuWae?p=preview - use checkbox on top for lock/unlock

Version of Angular, UI-Select, and Bootstrap/Select2/Selectize CSS

Angular: 1.4.9 or version used in Plunker demo

UI-Select: >=0.18.1

Bootstrap/Select2/Selectize CSS (if applicable): can't tell, look in Plunker demo (sorry)

@CraigJohnson
Copy link

I ran into this problem, too. The fix in #1824 fixes it for me. Just waiting for the next release.

@Mugi4ok
Copy link
Author

Mugi4ok commented Dec 22, 2016

@CraigJohnson, ah, so the culprit is already found, good to hear. Looking forward to the next release then :)

@Jefiozie
Copy link
Contributor

Jefiozie commented Mar 7, 2017

Just checking but is this already fixed in the 0.19.5 release?

@CraigJohnson
Copy link

No, it is not. Until lockedItems.splice(lockedItemIndex, 0); is changed to lockedItems.splice(lockedItemIndex, 1); (here), it's not fixed.

@Jefiozie
Copy link
Contributor

@CraigJohnson would you mind making a "new" PR for this with some tests. Happy to review.

Thanks

@CraigJohnson
Copy link

@Jefiozie
Copy link
Contributor

Ah I see thanks will add it to the list for the new release.

@Jefiozie Jefiozie added this to the v0.19.6 milestone Mar 14, 2017
@Jefiozie
Copy link
Contributor

Can be closed now as it is merged.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants