Leashing a mob to a fence keeps the leash in the player's hand and the mob will still follow.
The bug
Leashing a mob and tethering it to a fence will keep the leash in the player's hand, and the mob will continue to follow, with the fence appearing as if the leash is attached to it.
How to reproduce
Put a leashed mob on a fence.
Click the fence again to make it now stay tethered.