I feel pretty confident that the endpoint of such research would be "it's essentially random because it gets sorted out by your head and hormones during critical development years", but you're 100% correct that if they found a gene for it people would test and selectively abort it. We've already seen what happens when a society with access to abortion creates uneven pressure on what kind of kids you should have - China during the One Child policy - so until the day comes that the entire population is totally fine with having an LGBT kid it's knowledge that would do more harm than good.
I feel pretty confident that the endpoint of such research would be "it's essentially random because it gets sorted out by your head and hormones during critical development years", but you're 100% correct that if they found a gene for it people would test and selectively abort it. We've already seen what happens when a society with access to abortion creates uneven pressure on what kind of kids you should have - China during the One Child policy - so until the day comes that the entire population is totally fine with having an LGBT kid it's knowledge that would do more harm than good.