-
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
Fixed focusing a widget after blurring editor for edge #1466
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.
In the PR description you marked it contains unit test, but I don't see any. It would be good to add some.
@@ -414,7 +414,7 @@ | |||
}, | |||
|
|||
applyFormatting: { | |||
editorFocus: false, | |||
editorFocus: CKEDITOR.env.ie && !CKEDITOR.env.edge ? false : true, |
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.
With such condition (CKEDITOR.env.ie && !CKEDITOR.env.edge
) you will get false
for all IEs and true
for Edge and all other browsers different than IEs.
From what I understand it should be true
only for Edge and false
for others, so in this case it should be CKEDITOR.env.ie && CKEDITOR.env.edge ? true : false
.
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.
No, it should be false for an IE. It is old fix where IE with editor focus will scroll up if an image is at the bottom of a scrollable container bdbd071.
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.
Ok, I see, after F2F talk, the reason was to rollback the editorFocus: false
change as initially it should be applied only for IEs, but was applied for all browsers (see https://dev.ckeditor.com/ticket/16845). So now editorFocus: false
should be only used for IEs.
That was also a reason for modifying manual test (which is answer for #1466 (comment)).
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.
Sorry for misleading information about unit tests. As we talked F2F there is no easy way to test this issue directly in the code, so I will skip this part and use manual tests.
@@ -0,0 +1,18 @@ | |||
@bender-tags: bug, 4.8.1, copyformatting, 1458 |
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.
Target version should be 4.9.0
.
} | ||
|
||
CKEDITOR.replace( 'editor1', { | ||
width: '30em', |
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.
Not sure if such detailed width
and height
is needed, was there any particular reason for this?
@@ -1,4 +1,4 @@ | |||
@bender-tags: bug, 4.7.0, trac16845, copyformatting | |||
@bender-tags: bug, 4.7.0, trac16845, copyformatting, 1458 |
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.
If this test is important for this fix it should also contain 4.9.0
version tag. If not, you shouldn't have added 1458
ticket number.
</textarea> | ||
|
||
<script> | ||
CKEDITOR.replace( 'editor1' ); |
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.
Again, from what I understand this was the Edge only fix, what was the reason of removing
if ( !CKEDITOR.env.ie ) {
bender.ignore();
}
ignore from this test? Does the changes somehow affect other browsers?
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 problem was with IE, but older fix corrupted Edge, so I thought it's good idea to test all other browsers.
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.
Looks good 👍
Just some details in tests needs fixing.
@@ -0,0 +1,18 @@ | |||
@bender-tags: bug, 4.9.0, copyformatting, 1458 |
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 tag to 4.9.1
.
@@ -0,0 +1,18 @@ | |||
@bender-tags: bug, 4.9.0, copyformatting, 1458 | |||
@bender-ui: collapsed | |||
@bender-ckeditor-plugins: copyformatting,toolbar,wysiwygarea,floatingspace,elementspath,image2,widget,justify,div |
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.
You could easily run this test with only copyformatting,toolbar,wysiwygarea,image2
. No need for additional plugins.
## Test Scenario | ||
|
||
1. Make sure the editor is not focused. | ||
2. Select the image on the left by clicking it. |
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.
by clicking on it.
|
||
1. Make sure the editor is not focused. | ||
2. Select the image on the left by clicking it. | ||
3. Remove selection from the image by clicking outside of the editor. |
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.
outside
ofthe editor.
@@ -0,0 +1,41 @@ | |||
|
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.
Is this blank line really necessary?
@@ -1,4 +1,4 @@ | |||
@bender-tags: bug, 4.7.0, trac16845, copyformatting | |||
@bender-tags: bug, 4.7.0, 4.9.0, trac16845, copyformatting, 1458 | |||
@bender-ui: collapsed | |||
@bender-ckeditor-plugins: copyformatting,toolbar,wysiwygarea,floatingspace,elementspath,image2,widget,justify,div |
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.
Same here, you only need copyformatting,toolbar,wysiwygarea,image2,justify,div
(I know this tests was not added by this PR, but it is a good opportunity to fix it:D).
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 👍
Should be merged to |
Retargetting into a |
What is the purpose of this pull request?
Bug fix
Does your PR contain necessary tests?
All patches which change the editor code must include tests. You can always read more
on PR testing,
how to set the testing environment and
how to create tests
in the official CKEditor documentation.
This PR contains
What changes did you make?
Added condition to focus editor for CKEDITOR.plugins.copyformatting.state#applyFormatting event only when client browser is IE .
Closes #1458