Opened 10 years ago

Closed 9 years ago

Last modified 7 years ago

#393 closed Bug (fixed)

Cursor inside link but expected to be "after" it

Reported by: williamsn Owned by:
Priority: Normal Milestone: FCKeditor 2.5 Beta
Component: General Version: FCKeditor 2.4.1
Keywords: Confirmed Firefox Cc: lizl@…

Description

This problem is hard to explain, but easy to repeat:

Go into Internet Explorer, create a hyperlink using the toolbar hyperlink tool, and click "Ok". Put your cursor on the right side of the link and start typing.

Now do the same thing in Firefox.

See the difference? In Internet Explorer, the new text you type isn't part of the link, but it is in Firefox. In fact, the only way to close the link is to now use the source button.

Just aggravating.

Thanks,

Nicholas

Change History (9)

comment:1 Changed 10 years ago by fredck

  • Keywords Confirmed Firefox added; firefox link close type removed
  • Milestone FCKeditor 2.4.3 deleted
  • Summary changed from FF: Link tag doesn't close when typing after it to Cursor inside link but expected to be "after" it

Confirmed with FF2. Ok with IE6.

The problem is the way that FF handles the selection on link boundaries. Actually, if you try to do that with the keyboard, when coming from the left until reach the end of the linked word, the cursor is "inside" the <a>. If you instead come from the right, with th left key, and reach the exact same place with the cursor, then it will be out of the link. Even with the mouse click it will not always happen.

It sounds like those browser limitations that are very difficult to fix from our side, and it would be better to have a FF fix instead, but let's investigate it better first.

comment:2 Changed 10 years ago by alfonsoml

I think that a possible solution would be to check on link creation if there are any siblings after the link node, and if there aren't any then add just a space, that way people can place the cursor after the link much more easily.

Drawback: an extra space is added.

Note: in Thunderbird there's a "discontinue link" Ctrl+Shift+K, maybe we could try to check if it does anything in Javascript or it is C++ land.

comment:3 follow-up: Changed 10 years ago by alfonsoml

#441 has been marked as dup.

Note: I did try to follow the idea that I proposed but I didn't managed to make it work properly, it seems that firefox does special handling of spaces so even if I add a space in the DOM I can't put the cursor after it (but it did work if it was a letter).

Maybe I'll try again in the future.

comment:4 in reply to: ↑ 3 ; follow-up: Changed 10 years ago by roberto85

Replying to alfonsoml:

Even if u tried to insert a space or a letter , this is a solution when you are inserting a link , but not when you have a link already inserted or already exists in a page , in this case it is impossible to add anything , unless u are changing from the source code

Regards Robert

comment:5 in reply to: ↑ 4 Changed 10 years ago by alfonsoml

Replying to roberto85:

Replying to alfonsoml:

Even if u tried to insert a space or a letter , this is a solution when you are inserting a link , but not when you have a link already inserted or already exists in a page , in this case it is impossible to add anything , unless u are changing from the source code

Regards Robert

Yes, but I don't think that this case is so severe as the fact that you are writing, then create a link and can't get out of it. I don't expect too many content that ends with a link without at least a dot.

That's not to say that it shouldn't also work, but it will need another idea.

comment:6 Changed 10 years ago by fredck

  • Milestone set to FCKeditor 2.5

Related to #332 (Maybe a DUP).

comment:7 Changed 10 years ago by alfonsoml

  • Cc lizl@… added

If you create a link at the end of a line and then hit the end key or go to the end of the link after creating it and begin typing some more characters, the characters you type are added to the link you just created.

In Firefox they are added to the link immediately and any spaces are included in the link.

In IE they are added to the link as soon as you hit the space key. The spaces are not included and any characters after the space is not included in the link.

It would be more user friendly if the link didn't continue as you type additional characters after it.


A workaround is to hit enter between the link you want and the linked characters you dont want linked and then use the "Remove Link" button to remove the link from the characters you dont want linked.

A side effect of this is that in Firefox, the enter key then begins to put in <p>'s instead of <br>'s.


Moved from SF. Original reporter lizl
https://sourceforge.net/tracker/index.php?func=detail&aid=1638170&group_id=75348&atid=543653

comment:8 Changed 9 years ago by alfonsoml

#976 has been marked as dup

comment:9 Changed 9 years ago by martinkou

  • Resolution set to fixed
  • Status changed from new to closed

I've committed the changesets [596], [597], [598] and [599] into fixing this bug.

The changesets I've uploaded are basically patches to the default caret behavior in Firefox. The goal is to make it behave more like MS Word when it comes to the end of inline, style texts (e.g. bold texts, hyperlinks).

The changes implemented are as follows:

  1. If the caret is moved to the end of a hyperlink by the keyboard, then hyperlink mode is disabled. This is consistent with the behavior of MS Word.
  2. If the caret is moved to the end of other styled inline tags by any key other than the <End> key (like bold text or italic text), the original bold/italic/... modes would continue to be effective. This is consistent with the behavior of MS Word.
  3. If the caret is moved to the end of other styled inline tags by the <End> key, all style tag modes (e.g. bold, italic, underline, etc.) would be canceled. This is not consistent with MS Word, but provides a convenient way for the user to escape the style mode at the end of a line.
Note: See TracTickets for help on using tickets.
© 2003 – 2016 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy