There's an idiom in Argentina translated roughly as "to sleep someone" (dormir a alguien), which is used when someone frustrates the plans of someone else by taking what the other person wanted in the first place and who obtains the benefit knows it. This may cover different situations, for example:
If you walk ahead in the street to hail the taxi another person was about to hail.
If you start dating someone another person you know was eager to ask for a date and you knew it.
If you take the last slice of a pizza someone who went for a drink said was going to take.
I'm looking for an idiom in English which describes this kind of behavior or situations.