When people are sad, distraught, depressed, etcetera, it is common to turn our attention inward. We think about what happened yesterday, or last year, or 10 minutes ago, or what we're going to do when we get home, or next week, or whenever. In other words, we're not in the present moment. Even if it looks like a person is seeing what's going on around them, it could very well be the only thing they're aware of is how they are feeling.
Practice compassion. You just never know what is happening in someone's life. They may be struggling through a trauma. To get upset about not receiving a thank you, is such a trivial thing.
We've all had times in our life that we can't muster up a smile, we can't swallow hard enough to speak, we can't look up from the ground, or we're simply oblivious to our surroundings.
Know this: if someone totally ignores you as you hold a door, the kindness that you offered is probably more important, more helpful, than what you do for the person who has what it takes to look you straight in the eye, smile, and say thank you.
The next time you do something nice for someone, anything nice, and you are ignored, I thank you for doing that.