Only collapse empty comment box

fixes #5292