-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#17028] Tabbing through inline editor causes JavaScript error. #451
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix is not working correctly. After tabbing into editor, there is no caret inside and it's impossible to type anything. This is probably caused by the fact that in Chrome selection is removed from window when blurring inline editor → http://dev.ckeditor.com/ticket/13446
The real fix for this issue would be ensure that elements path is always set when focusing the editor. In other words: ensure that there is a caret inside newly focused editor.
<head> | ||
<script> | ||
if ( bender.tools.env.mobile ) { | ||
bender.ignore; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bender.ignore
is a function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ups.
Done.
It seems that problem start to occur after introducing change in 3f07b6d. |
@@ -0,0 +1,12 @@ | |||
@bender-tags: 4.7.1, tc, gh424 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update tags to the new convention.
@@ -0,0 +1,12 @@ | |||
@bender-tags: 4.7.1, tc, gh424 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update tags to the new convention.
plugins/indentlist/plugin.js
Outdated
if ( editor.mode != 'wysiwyg' ) | ||
return; | ||
|
||
if ( evt.data.keyCode == this.indentKey ) { | ||
var list = this.getContext( editor.elementPath() ); | ||
// Prevent of getting context of empty path. (#17028) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update ticket number.
core/dom/elementpath.js
Outdated
@@ -57,6 +57,11 @@ | |||
// Backward compact. | |||
root = root || startNode.getDocument().getBody(); | |||
|
|||
// Assign root value if startNode is null (#17028). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update ticket number.
tests/core/focusmanager/editor.js
Outdated
@@ -109,7 +109,12 @@ bender.test( { | |||
resume( function() { | |||
editor.on( 'blur', function() { | |||
resume( function() { | |||
assert.areSame( 'None', editor.getSelection().getNative().type ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these tests still needed? It seems that now they're checking the native Chrome's implementation.
There is also manual test for it (core/focusmanager/manual/typinginunfocusedinlineeditor
), which became unneeded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but there are some cleanup tasks left. Let's do them and finish this PR!
core/dom/elementpath.js
Outdated
@@ -57,6 +57,11 @@ | |||
// Backward compact. | |||
root = root || startNode.getDocument().getBody(); | |||
|
|||
// Assign root value if startNode is null (https://dev.ckeditor.com/ticket/17028). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update tickets numbers to the new convention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Comandeer I'm a little bit confused, according to #470, there should be permanent link to issue in track. And it is there, or do I missed something?
Or by new convention you understand reference to github issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I mean adding reference to GH issue alongside the reference to trac.
plugins/indentlist/plugin.js
Outdated
if ( editor.mode != 'wysiwyg' ) | ||
return; | ||
|
||
if ( evt.data.keyCode == this.indentKey ) { | ||
var list = this.getContext( editor.elementPath() ); | ||
// Prevent of getting context of empty path (https://dev.ckeditor.com/ticket/17028). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update tickets numbers to the new convention.
@@ -0,0 +1,12 @@ | |||
@bender-tags: 4.7.1, tc, 424 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update tags to the new bug/feature convention.
Additionally this test does not make much sense in browsers other than Chrome (as this thing was always working there) – let's run it only in Chrome.
tests/plugins/indentlist/taberror.js
Outdated
}; | ||
|
||
bender.test({ | ||
'test tab in inline editor': function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add ticket reference here, just for clarity?
}; | ||
|
||
bender.test({ | ||
'test tab in inline editor': function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add ticket reference here, just for clarity?
@@ -0,0 +1,12 @@ | |||
@bender-tags: 4.7.1, tc, 424 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update tags to the new bug/feature convention.
Additionally this test does not make much sense in browsers other than Chrome (as this thing was always working there) – let's run it only in Chrome.
@@ -0,0 +1,40 @@ | |||
<head> | |||
<script> | |||
if ( !CKEDITOR.env.chrome ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move it to the script
in body
as it apparently does not work in head
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting.
when I fired the test from link:
http://tests.ckeditor.dev:1030/#tests/path:/tests/plugins/indentlist/manual with a play button it seemd to be ignored, but there is no notification when test is opened directly.
I moved condition to body to work properly.
@@ -0,0 +1,40 @@ | |||
<head> | |||
<script> | |||
if ( !CKEDITOR.env.chrome ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move it to the script
in body
as it apparently does not work in head
.
What is the purpose of this pull request?
Bug fix
It's PR related to #424
Does your PR contain necessary tests?
yes
This PR contains
What changes did you make?
Add checks in 2 places that values are defined.
close #424