Opened 9 years ago
Last modified 8 years ago
#14288 review_passed Bug
Autolink in Firefox places caret inside link
Reported by: | Mark Wade | Owned by: | kkrzton |
---|---|---|---|
Priority: | Nice to have (we want to work on it) | Milestone: | |
Component: | General | Version: | 4.5.0 |
Keywords: | Cc: | mike@…, shawn@… |
Description
Steps to reproduce
- Using Firefox, go to a CKEditor build which has the autolink plugin present.
- Paste a URL, for example https://www.google.co.uk
- Hit space and continue typing
Expected result
The text you type appears after the link, not part of it (is behaviour in Safari and Chrome).
Actual result
The text you type is linked as if it was part of the URL.
Other details (browser, OS, CKEditor version, installed plugins)
Tested with:
- Firefox 43.0.2 (latest at time of creating ticket) on Mac OS X 10.11.2 (latest at time of creating ticket)
- CKEditor 4.5.6 (latest at time of creating ticket), Basic preset plus autolink plugin, Moono theme with English language
Effectively makes the autolink plugin unusable.
Change History (15)
comment:1 Changed 9 years ago by
Keywords: | autolink removed |
---|---|
Status: | new → confirmed |
Version: | 4.5.6 → 4.5.0 |
comment:2 Changed 9 years ago by
Milestone: | → CKEditor 4.6.0 |
---|
comment:3 Changed 9 years ago by
Owner: | set to kkrzton |
---|---|
Status: | confirmed → assigned |
comment:4 Changed 9 years ago by
There are few related issues: #7830, #8958, #10872, #11346, #12649. All are still valid at the moment. Probably the cause is not the same for all of them but some are surely connected so all of them should be taken into consideration when working on the solution.
comment:5 Changed 9 years ago by
This issue does not concern only autolink plugin but more general problem with handling links in FF (and differences in handling links in other browsers).
comment:6 Changed 9 years ago by
comment:7 Changed 9 years ago by
Run some tests how selection between different elements is handled inside contenteditable in different browsers.
It seems Chrome and IE are consistent (except #8149 for Chrome).
Firefox has like "stateful" selection. It means selected element depends on from which element cursor was moved or which element clicked. So in FF the selection for the same position depends on what user clicked or from what element moved the cursor. The exact same position can have to different selections/states. In other browsers same position always reports the same selection no matter what user did previously.
This behavior in FF is the cause of this and some of related issues.
comment:8 Changed 9 years ago by
Cc: | mike@… added |
---|
comment:9 Changed 9 years ago by
Status: | assigned → review |
---|
Changes in t/14288.
The code also fixes #10709 for FF. IE needs to be handled separately (or probably may use same solution).
There is also an edge case caused by bogus <br>s mentioned here 10966#comment:2, 10966#comment:6.
comment:10 Changed 9 years ago by
comment:11 Changed 8 years ago by
Status: | review → review_passed |
---|
comment:12 Changed 8 years ago by
Milestone: | CKEditor 4.6.0 → CKEditor 4.6.1 |
---|
comment:13 Changed 8 years ago by
@tade0 I checked this solution along with #14563 issue. After some small adjustments (listener priorities), this fix could be possibly used also for #14563 (ofc additional testing will be required for affected browsers).
If we would like to go this way I will suggest creating a parent ticket for those two issues so that we can have the code for both issues in a one place.
comment:14 Changed 8 years ago by
Milestone: | CKEditor 4.6.1 |
---|---|
Priority: | Normal → Nice to have (we want to work on it) |
This issue is too risky to take it in upcoming minor release. Let's put it in our todo backlog.
comment:15 Changed 8 years ago by
Cc: | shawn@… added |
---|
Problem can be reproduced from CKEditor 4.5 (when autolink was introduced) and is most likely related to #8195 (please also see https://dev.ckeditor.com/ticket/7796#comment:4)