Opened 5 years ago

Last modified 5 years ago

#13149 confirmed Bug

[Windows Phone 8.1] Selection is not watched correctly so it is lost when blurring editor

Reported by: Rikki Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

Test case: http://s.codepen.io/boomerang/43cbe53e7b6cec53f1410ecc00540be61428432853936/index.html

To reproduce:

1) Type some text in CKEditor

2) Focus on the other input field (to blur CKEditor)

3) Click the button to insert a small image

On all browsers except Windows Phone 8.1, the image is inserted at the last cursor location. On Windows Phone 8.1, the image is always inserted at the start of the CKEditor field.

Change History (2)

comment:1 Changed 5 years ago by Rikki

The full codepen example is at http://codepen.io/anon/pen/ogRMPY

comment:2 Changed 5 years ago by Piotrek Koszuliński

Status: newconfirmed
Summary: insertHtml inserts at start of content on Windows Phone 8.1 when editor focus is blurred[Windows Phone 8.1] Selection is not watched correctly so it is lost when blurring editor
Version: 4.4.7

Did you try preventing the default action of that click? If you do this, then it will not steal focus from the editor. So this may be a quick workaround.

The reason for the issue is that IEs support only one selection per browser tab let's say, while all other browser support one selection per every window (so when there's an iframe, there can be a selection outside it and inside). This means that we must watch the selection and remember it position because once the editor is blurred, it's lost. Hence, the image is inserted at the beginning.

Anyway, this is a tricky thing to do and we do not fully support Windows Phone yet, so it doesn't work there. On mobile devices watching selection must be done differently than on desktop devices because there are different events fired.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy