1- (I - implied subject) Thank you for being a good listener
unshortened situation: I thank you because you are a good listener
2- (You - implied subject) Promise her for being a good listener
unshortened situation: You promise her because she is a good listener
3- She is famous for being a good listener.
unshortened situation: She is famous because she is a good listener
Third sentence is grammatically correct, but first and second sentences are not grammatically correct because there are dangling modifier in the sentences.
Second question: Is this situation valid for imperative sentences or only thank-you sentence?
Thank you for your answer in advance