Normally, in your inventory, if you have multiple partial stacks of items, you can double-click one, which will pick up that stack and fill it to the max stack size using other items in your inventory. For example, if you have five stacks of 20 cobblestone, double-clicking one will pick up a stack of 64, removing some from the other stacks.
In the new villager trading UI, this doesn't work. Double-clicking a stack simply picks up the partial stack, then places it back down in the inventory. This is frustrating in this case because trading often leaves you with partial stacks that you need to refill to continue trading.
Related issues
Comments

No, you can't double-click stacks at all in the new UI. Whether or not that bug would still happen if you could though, I'm not sure.
Hmm, right. There seems to be another ticket about this already though: MC-148867. Resolved this ticket as a duplicate of that one.
Does MC-129515 describe your issue?