May or may not be a bug. When trading with a villager, he asked for 37 flesh, in return in would give and emerald, i went ahead. next he asked for 10 gold for an emerald, i put 10 gold in the previous 37 rotten flesh slot, it offered me the emerald, if it is for convenience the fair enough, but if not, it is a weird bug. the attachment shows the 10 gold in the 37 rotten flesh block and it offering the emerald, sorry if the resource pack i was using is inconvenient...
It is for convenience.