Get the click item in the select2:unselecting event


#1

Select2 version: 4.0.5

I need to get the clicked item of a multi select2 while I try to unselect it. I need to get the item before the unselect action happens.

Example:

I have a multi select2 with 4 options: op1, op2, op3, op4

In this select2 I have op1 and op3 selected after the page is loaded and if I click in the X to deselect the op3 I want to this action not happens (select2:unselecting) but I want to access the option clicked (in this example: op3) to manipulate this in my event and if the user accept the changes after that I complete the action deselecting the op3 and saving the state.


#2

I solved using the unselect event, from this event I can receive the option (event.params.data.element) that I clicked.