kennygrant / gohackernews

Golang News - curated links about the Go programming language
https://golangnews.com
MIT License
282 stars 42 forks source link

Blank comments #24

Closed kennygrant closed 7 years ago

kennygrant commented 7 years ago

Occasionally seeing blank comments, would like to work out why.

daenney commented 7 years ago

I can explain what happened in my case. When I click reply on a comment the viewport of the page scrolls back to the top, to the regular comment field, which suggests that's where you should type your reply. If you enter a comment there, it's posted as a top comment, which wasn't my intention, I wanted to reply to yours, but it wasn't obvious that that's what would happen. I realise the "submit" button is named differently but that isn't enough of a differentiator to trigger a "hey maybe there's another comment field somewhere outside of your view". Since I can't delete my comments I edited/blanked out my comment, hit reply again on yours and then scrolled back to the bottom where now a second comment field appears and submitted through that.

This only appears to be a problem if the comment you're replying to isn't on the part of the page (from the top) that fits on your screen as you initially load the page. So if I hit "reply" on a comment at the top everything's mostly fine as the reply field spawns within my view making it obvious that there's where I should reply. However, if the comment I want to reply to is a few "pages/scrolls" down, the rewinding of the page to the top makes it very confusing.

Oddly enough, even if you submit in the right comment field, it sometimes seem to render it as a comment instead of a reply the first time around.

In my case I'm using Safari Version 10.1 (12603.1.30.0.34) on macOS 10.12.4 but I observe the same behaviour on Firefox.

daenney commented 7 years ago

As far as I'm able to understand I think the behaviour is triggered by the fact that when clicking on the "reply" button a # is appended to the URL. Browsers interpret that as an anchor and since none seem to exist it just goes to the top of the page.