I can relate. Obviously, I don't know how to overcome it. Frankly, I don't think I personally can. Even without telling a person about my issues, they still manage to disappear anyway. The ones who don't disappear on me are just as done with life as I am.
I just recently was trying to cultivate a new friendship, but once I told them honestly how I feel, I got the old "everyone's life is hard; giving up is not an option; you just have to make different choices/ try harder" bullshit. They also implied that I'm weak because they "have been through things that would have made you kill yourself years ago."
I think certain types of people will just never understand that not everyone can react to things the way they do, and that not everyone believes life is inherently valuable or desirable even in the face of terrible suffering.
I don't really regret pushing such people away. I am the way I am because of a combination of many different factors outside of my control. If others are unwilling or unable to understand that, there's no point being around them anyway. I've tried things their way and it doesn't work for me. If they don't like it, too bad. It is what it is.