Please improve the behavior of the tool-tip of selected text

Ramkhamhaeng

Warlord
Joined
Feb 24, 2014
Messages
215
Hello,

the forum software shows an, in my opinion, really annoying behavior: It's a common reflex to mark text with the mouse during reading a longer text. In this forums this immediately triggers a tool-tip below the selected text. This disturbs the reading flow because it overlays the next line to read.

I would suggest to change the functionality by:
1. Only show the popup if multiple words, e.g. 3, are selected.
2. Place the tool-tip, at least for one-liner, top of the selected text where it simply can be ignored.

Please post in this thread if you also find such a change useful. Maybe it's just me who is annoyed by the current state… ;)


To be more constructive I've viewed into the CSS/JS stuff: I've found this code in js/xf/message.js:
Code:
 981       if (!range.toString().trim().length)                                                                                         
 982       {                                                                                                                            
 983         if (!range.cloneContents().querySelectorAll('img').length)                                                                 
 984         {                                                                                                                          
 985           return null                                                                                                              
 986         }                                                                                                                          
 987       }

So for the first suggestion this code (untested) should suppress the popup for less than three words.
Code:
            const text = range.toString.trim()
            if (!text.length)
            {
                if (!range.cloneContents().querySelectorAll('img').length)
                {
                    return null
                }
            }

            // Avoid popup with less than 3 words
            if (text.split(" ", 3).length < 3) return null

Changes for 2. are more complex (e.g. little arrow in the tooltip box of current style pointing to the text (css class tooltip--bottom → tooltip-top), thus I do not wanna suggest code for a replacing of the tooltip.
 
Last edited:
Odd, I'm not getting the tooltip popup you mention. I've checked and I do have javascript enabled and I don't have any content blockers setup for CFC. I am a supporter, though I doubt that would affect the tooltip.

I'm on a 2020 MacBook Air. I've tested it in both Safari and Chrome.
 
Might be an issue of the phrasing, as I'd not call it a popup.
I assume the one screenshotted below is meant?

tooltip.png


In this case we don't have direct control over it. The software is controlled by Xenforo, and while we can do manual edits, this will mess with further updates, so I'd prefer not to do that unless absolutely necessary.
 
Yes, I meant the tool-tip that can be seen on J's screenshot.
screenshot0333.png

If you don't want to change it, ok. I had assumed it was one of the changes you make to the default version of a forum software.
 
I had a quick look, this doesn't seem to be one of the options which is expressed via the interface and modifiable.
It also seems that we cannot modify the underlying javascript. I can override the default CSS, if I like, but I don't think your suggestion can be done with only CSS.
 
Back
Top Bottom