1

Topic: Double clicking to highlight text

Is there a way to eliminate the trailing space that is highlighted when double clicking text?

For instance, when creating a hyperlink, I double click the word to highlight and when the underline of the hyperlink is created, there is an extra blank space after the word that is also selected on double click...

any thoughts?

peace and moofasa.

2

Re: Double clicking to highlight text

I also have this issue, anything new yet?

3

Re: Double clicking to highlight text

This should be a vendor-specific behavior. Maybe certain event listeners can help fix that...

Greetings from Germany,

Felix Riesterer.
(-> about me and this forum <-)

4

Re: Double clicking to highlight text

Use the event:
http://www.tinymce.com/wiki.php/API3:ev … onDblClick

You can trim the selection

5

Re: Double clicking to highlight text

Thanks for the reply, this returns the node, could you continue and show how to get the innerhtml of selected node and trim is using tinymce (I don't want to rely on jQuery) and then shorten the selection minus the spaces?

6

Re: Double clicking to highlight text

Not sure why the behavior is to select the trailing white space. All browsers and word does this so it's the default way of desktop apps.

Best regards,
Spocke - Main developer of TinyMCE

7

Re: Double clicking to highlight text

I fixed it by using the second parameter in select(). That boolean makes the CONTENT of the tag to be selected, instead of the tag itself.

Unfortunately, there are other factors I'm trying to workaround.
One of them is formatting.
Yes. just by floating the element, double clicking behavior changes, grabbing all the siblings as well! as if the current tag and all its siblings were a single word (even if adding extra spaces between them)

Check this post for the details:
http://www.tinymce.com/forum/viewtopic.php?id=34474

Until I find a better answer, I used instead flex-box display instead of block. Now when I double click it, it only selects the content smile

Last edited by sergiozambrano (2015-04-14 08:58:27)