Shearing sheep attacks the sheep
When you click the "Shear" button, if the part of the button you are touching is over the sheep, the shearing occurs, but the sheep is also attacked and takes damage.
If you approach the sheep to shear in a way where the "Shear" button is not physically over the sheep, then the shearing does not attack the sheep.
Before 12.1, the "Shear" button would only shear.