This should be resolved in the latest version of Discourse - the autocomplete menu now opens based on whether the top segment or bottom segment of the screen from the cursor (if you imagine the cursor as a horizontal line dividing across your screen) has more space. So for the cases pictured here, you should expect it to appear below the cursor.
2 Likes