simonwep/selection

Selecting and deselecting is not working correctly

lubomirblazekcz opened this issue · 0 comments

What is the problem?

When deselecting elements, the behaviour starts to get buggy. Repro steps:

  1. select some items, and deselect all - then select all, those items won't be selected
  2. select all items, and deselect all items - same as first case, none of items are selected
  3. select all, deselect all and then select some new items - now you can select all again and it's working correctly

Please provide the steps to reproduce and create a CodeSandbox.

https://codesandbox.io/s/viselect-vanilla-forked-mq57dz?file=/src/main.ts