I can't figure out a good way to fix this bug. If I uncheck square, uncheck red, then recheck red, the red square comes back. How can I make sure I don't add any of the unchecked shapes back when the user unchecks and checks a color?
My real work example has more checkboxes and 100 times more data. JSFiddle clearly shows the bug.
thanks!