ng2-select2 icon indicating copy to clipboard operation
ng2-select2 copied to clipboard

Changing value dynamically only works first time

Open renan-ti opened this issue 7 years ago • 2 comments

This problem can be reproduced in ng2-select2-demo (4. Demo with a value changing): https://nejczdovc.github.io/ng2-select2-demo/

  1. Click "Change value". Result: Selected value in select 2: car2
  2. Select car1. Result: Selected value in select 2: car1
  3. Click "Change value" again. Result: Selected value in select 2: car1 Expected: Selected value in select 2: car2

renan-ti avatar Sep 28 '17 07:09 renan-ti

I met the problem too. I thing it's a bug. Is the anyway to fix the problem??

MinsuLim avatar Jan 26 '18 05:01 MinsuLim

I thought the answer could be that the function which the button uses allways set the startValue to 'car2' as you can see here.

However, the solution to this I think it would be public changeValue() { this.startValue = this.exampleData[Math.floor(Math.random() * this.exampleData.length)].id; } but it does not work either.

Gummiees avatar Apr 13 '18 07:04 Gummiees