optimistex / ngx-select-ex

Angular based replacement for select boxes
https://optimistex.github.io/ngx-select-ex/
MIT License
111 stars 42 forks source link

disabled on item not working #132

Open galvakojis opened 5 years ago

galvakojis commented 5 years ago

https://stackblitz.com/edit/ngx-select-ex-issues-100-uezwvq?file=app/app.component.ts

expected behavior: after selection an item in "a", in "b" that item should be disabled

looks like [items] array is not refreshing after changes

optimistex commented 5 years ago

@galvakojis Try it: https://stackblitz.com/edit/ngx-select-ex-issues-100-eddq5b

galvakojis commented 5 years ago

it is working... but then how about vice versa? when something is selected on "b" it needs to disabled on "a"

optimistex commented 5 years ago

@galvakojis It was just an example, not perfect but shows an idea.

optimistex commented 5 years ago

@optimistex Konstantin Polyntsov: If you want you can try to improve the component. I'll publish it as a dev branch. Better to make tests. I would help you but I'm too busy right now. If you consider to maintain then feel free to ask me

galvakojis commented 5 years ago

@optimistex i think the problem is with item differs(?) it should check changes of object properties also

optimistex commented 5 years ago

@galvakojis Probably it is because of: https://github.com/optimistex/ngx-select-ex/blob/0d7e08f15f4e80fa991fc121dd53aa3fb0d89758/src/app/lib/ngx-select/ngx-select.component.ts#L38

It was added by one of maintainers for some performance. So, probably we need use a code like this: https://github.com/optimistex/ngx-select-ex/blob/0d7e08f15f4e80fa991fc121dd53aa3fb0d89758/src/app/lib/ngx-select/ngx-select.component.ts#L203

Unfortunately, I have no so much time to investigate it for now. It would be cool if you'll found some time to fix it.