In Single-player, creative mode, use Ctrl-Q to throw a stack of items from your inventory, not your hotbar, into a hopper.
Close your inventory.
Open the hopper.
The stack of items is in your inventory and the hopper.
If you re-open your inventory before opening the hopper, it doesn't happen.
It also doesn't happen in survival, so this is mainly an annoyance when testing things in creative, as you have to keep junking things from your inventory, which otherwise ends up full.
Related issues
Comments

Dupe of MC-5415