ngx-select-ex icon indicating copy to clipboard operation
ngx-select-ex copied to clipboard

disabled on item not working

Open galvakojis opened this issue 6 years ago • 6 comments
trafficstars

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

galvakojis avatar Dec 13 '18 13:12 galvakojis

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

optimistex avatar Dec 14 '18 08:12 optimistex

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

galvakojis avatar Dec 14 '18 12:12 galvakojis

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

optimistex avatar Dec 14 '18 15:12 optimistex

@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

optimistex avatar Dec 15 '18 17:12 optimistex

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

galvakojis avatar Dec 18 '18 07:12 galvakojis

@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.

optimistex avatar Dec 18 '18 08:12 optimistex