Triple-clicking last parapgraph doesn't toggle "Quote" button

AI-generated summary

A bug was reported where triple-clicking the last or only paragraph in a post fails to toggle the “Quote” button. DanielMarquard noted this occurred specifically in Chrome 57.0.2987.133, while dax confirmed that Firefox handles the action correctly. The issue was traced to a selection logic edge case where triple-clicking spans over the .cooked div into the .post-menu-area.

zogstrip identified that tgxworld may have inadvertently altered the previous fix while working on highlighting the “like” count text in a different commit 10. After reviewing the code path, tgxworld acknowledged the oversight and implemented a solution in ce9fe21, effectively resolving the issue.

Triple-clicking the last (or only) paragraph in a post does not toggle the “Quote” button, at least for me in Chrome 57.0.2987.133.

It looks like this has been fixed previously, but may have resurfaced.

…so you probably can’t triple-click this text to quote it in a new reply.

3 Likes

You’re right, it’s relating to Chrome. With Firefox there’s no problem, triple click works very well.

5 Likes

Same on Chrome in ChromeOS:

Version 57.0.2987.148 (64-bit)
Plattform 9202.66.0 (Official Build) stable-channel falco
Firmware Google_Falco.4389.92.0

1 Like

I think this is only the last paragraph, I believe @zogstrip worked on making this more robust in the past, looks like there is an edge case.

I think @tgxworld removed/changed my fix. I don’t recall why though :expressionless:

1 Like

Which commit was it? I definitely did not remove it intentionally.

I think it was this one

https://github.com/discourse/discourse/commit/2165d0241e233db62fc5421f12f76f9b1389d56b

1 Like

Ah that commit was fixing the quote button appearing when highlighting the “like” count text. I’ll have a look.

When triple-clicking the last paragraph, the selection spans over the .cooked div and starts selecting content from the .post-menu-area section.

This is why I added these lines

https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/lib/utilities.js.es6#L92-L94

It’s the most reliable way I could find. There’s one thing I didn’t try: adding a .quotable div inside the .cooked div and ensure only that div is selectable.

But another fresh pair of :eyes: won’t hurt :wink:

4 Likes

Yea I’ll have to look through the code path again since it has been awhile.

4 Likes

Fixed in

https://github.com/discourse/discourse/commit/ce9fe213fdfd0a90bc8ed0e67b518bf34fd18762

7 Likes

This topic was automatically closed after 2 days. New replies are no longer allowed.