When clicking on a villager with any edible held item (and while hungry) you will start eating the item whilst in the trading menu.
This can be annoying while trading with farmers as I (and I'm sure others will too), might end up clicking on the villager with say, a carrot, but before the trade can even be completed the carrot is eaten and possibly reduces the amount of trades we can actually do.
Related issues
duplicates
Comments

Duplicate of MC-141494 - please search before reporting