On minecraft, how do you attach a lead to a villager?

When I right click on one with the lead in my hand, it only opens the trade option.

Added (1). I tried pushing shift at the same time I clicked and it did not seem to make any difference.

I tried it in single player and it has a special trick to it. You have to shift right click and of course you won't get it on your first try but you need good timing