Why would a guy act as if he fancied you for weeks and then all of a sudden after you went away for a week, he starts deliberately ignoring you?

Turns out he has a boyfriend, but never told you his orientation all this time.
Updates
+1 y
I am a woman by the way.
Why would a guy act as if he fancied you for weeks and then all of a sudden after you went away for a week, he starts deliberately ignoring you?
Post Opinion