This behavior was introduced in 19w42a.
The bug
While holding a block in the off-hand slot, attaching a leashed mob to a fence post will also place the off-hand block on the same side of the fence post that was clicked on. This occurs to me often, as I usually carry torches in the off-hand slot. See the attached video for an example of this behavior.
Steps to reproduce
Obtain a fence post, a lead, any leashable mob, and any placeable block (such as a torch).
Place the fence post, swap the placeable block to your off-hand slot.
Attach the lead to the mob, lead them to the fence post, and right-click on the fence post to attach.
Observed behavior
The lead will be attached, and the off-hand block will be placed within the same button press/right click (on default controls).
Expected behavior
The lead would be attached to the fence post while the off-hand block would remain in the off-hand slot, as was the case in versions prior to 19w42a.
Related issues
is duplicated by
Attachments
Comments


Can confirm in 25w21a

Thank you for your report!
We suspect that this does not occur in the latest version of Minecraft.
Is this issue present in the latest version of Minecraft?
This issue is being temporarily resolved as Awaiting Response. Once the requested information has been delivered, the report will be reopened automatically.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

Hello,
The video I originally attached is from 1.21.5. I had included this information in the “Environment” section as well but it looks like it was removed by an edit.
I have attached two new videos here demonstrating the behavior, from versions 1.21.5 and 25w21a respectively. These are the latest “release” and “snapshot” versions of Minecraft: Java Edition at the time of writing, with the snapshot having been released 6 days ago.
The F3 debug information is open in both videos to display the versions. Let me know if any additional info is needed.
[media][media]