Pressing Enter while hovering over the output field allows you to trade with a villager that is out of stock
Steps to reproduce:
1) Grab any villager with enough items to clear out its stock
2) Select a trade
3) Shift+click the output box to get the items, then press enter to add more items to the input
4) Repeat step 4 until the villager is out of stock
5) Press enter on the output box again, then shift+click. You should still be able to trade
If that confuses you, I have attached a video to help