When the item in your cursor runs out while ghost-building (or quick-inserting modules), the cursor instantly becomes a ghost of that item so you can keep placing.
Tweaks
Mod category: Tweaks
Small changes concerning balance, gameplay, or graphics.
Hello - There's a setting which allows using the pipette tool to pick ghost items/entities.
But from what I know, there's nothing in-game to prevent bots from emptying your cursor if they grab the last item of what you have selected for building.