Opened 10 years ago
Closed 9 years ago
#13446 closed Bug (fixed)
[Chrome] It is possible to type in unfocused inline editor
| Reported by: | Jakub Ś | Owned by: | Tomasz Jakut |
|---|---|---|---|
| Priority: | Normal | Milestone: | CKEditor 4.6.2 |
| Component: | General | Version: | 4.0 Beta |
| Keywords: | Chrome Support | Cc: |
Description
I have managed to reproduce it only in Chrome from CKEditor 4.0 beta.
- Go to massive inline creation sample
- Click into last inline editor (that small one at the very bottom)
- Press tab - Focus goes to link
- Star typing
Result - text is being typed into editor.
Change History (19)
comment:1 Changed 10 years ago by
| Keywords: | Support added |
|---|---|
| Status: | new → confirmed |
comment:2 Changed 10 years ago by
comment:3 Changed 10 years ago by
| Milestone: | → CKEditor 4.5.6 |
|---|
comment:4 Changed 10 years ago by
| Owner: | set to Tomasz Jakut |
|---|---|
| Status: | confirmed → assigned |
comment:5 Changed 10 years ago by
| Status: | assigned → review |
|---|
The only working fix is removing the entire selection after focusing element outside the editor. Pushed branch:t/13446.
comment:6 Changed 10 years ago by
| Status: | review → review_failed |
|---|
- I ran tests in Chrome and got over a hundred of
Uncaught TypeError: Cannot read property 'getNative' of nullerrors coming from https://github.com/cksource/ckeditor-dev/blob/t/13446/core/focusmanager.js#L161 in many different tests.
- A selection cached in https://github.com/cksource/ckeditor-dev/blob/t/13446/core/focusmanager.js#L153 may be outdated when
doBlur()is called in the timout https://github.com/cksource/ckeditor-dev/blob/t/13446/core/focusmanager.js#L178-L181. It's unsafe and may be a source of problems in the future.
- https://github.com/cksource/ckeditor-dev/blob/t/13446/core/focusmanager.js#L162 – shouldn't it be
editor.window? What would happen to a classic editor in such case?
- I see no tests for classic editor (
wysiwygarea–based).
comment:7 Changed 10 years ago by
| Milestone: | CKEditor 4.5.6 → CKEditor 4.5.7 |
|---|
comment:8 Changed 10 years ago by
| Status: | review_failed → review |
|---|
1, 2. I changed fix to detect inline mode in Chrome, not the existing selection. It seems to fix errors and removes the need of caching selection.
- Yes, it should be. I've changed that. Classic editor should be not touched (changes for 1. ensures that).
- I added test for classic editor to check if fix is not touching it (Chrome doesn't clean up selection in classic editor too, but it doesn't cause any errors, because the focus is moved entirely outside editor's window on blur - therefore fix leaves it as it is).
Pushed branch:t/13446.
comment:9 Changed 10 years ago by
| Milestone: | CKEditor 4.5.7 → CKEditor 4.5.8 |
|---|
comment:10 Changed 10 years ago by
| Milestone: | CKEditor 4.5.8 → CKEditor 4.5.9 |
|---|
comment:11 Changed 9 years ago by
| Milestone: | CKEditor 4.5.9 → CKEditor 4.5.10 |
|---|
comment:12 Changed 9 years ago by
| Milestone: | CKEditor 4.5.10 → CKEditor 4.5.11 |
|---|
Moving tickets to the next milestone.
comment:13 Changed 9 years ago by
| Milestone: | CKEditor 4.5.11 → CKEditor 4.6.1 |
|---|
comment:14 Changed 9 years ago by
| Milestone: | CKEditor 4.6.1 → CKEditor 4.6.2 |
|---|
Moving to 4.6.2 minor release, as 4.6.1 is mostly about polishing 4.6.0.
comment:15 Changed 9 years ago by
| Status: | review → review_failed |
|---|
Rebased it on current master and updated manual test version tag.
This solution looks like a good approach to solve this issue. However, one unit test is failing http://tests.ckeditor.dev:1030/tests/core/editor/title with Uncaught TypeError: Cannot read property 'hasAscendant' of null
.
comment:16 Changed 9 years ago by
| Status: | review_failed → review |
|---|
I've updated code on branch:t/13446.
The issue with the test is caused by the fact that handling for editor's blur is fired asynchronously. The invocation of insertText in loop, for all editors cause the blur handler to be fired after focusing the next editor, eventually clearing the selection in this editor's instance – if user is using Chrome and that editors are inline ones. IMO it's a situation very unlike to happen in the real world so fixing just the test should suffice.
I've also simplified checking for the inline editor in focusmanager.js.
comment:17 Changed 9 years ago by
| Summary: | It is possible to type in unfocused inline editor → [Chrome] It is possible to type in unfocused inline editor |
|---|
comment:18 Changed 9 years ago by
| Status: | review → review_passed |
|---|
Fixing tests is fair enough IMO. LGTM!
comment:19 Changed 9 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | review_passed → closed |
Merged to master with 8437204.

I have also verified the issue exists in version 4.4.7 with the div editing area plugin.