When you close your inventory, if you have an item on your cursor, it disappears.
Demonstration:
[media]Linked issues
Attachments
Comments


This has existed for several years. WAI

This is a duplicate of MC-87935, which was resolved as WAI by @unknown. However, that ticket was resolved in 2015, so perhaps a mod should mark that ticket for Mojang to review.
Only works in creative, in survival, it just drops the item, possibly works as intended