Changed the `selected` event to emit only if any new elements were selected and the `unselected` event to emit only if any selected elements were unselected.