-
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
Set correct focus on tab in dialog when is clicked #3499
Conversation
020b94c
to
cef63ba
Compare
Rebased onto latest |
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.
Generally, the fix looks good - it slightly changes focusing behaviour, but from what I see it makes it more consistent. Some polishing in dialogTools
still needs to be done.
}, 0 ); | ||
} ); | ||
|
||
CKEDITOR.tools.setTimeout( 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.
This timeout will be still executed even after resolve is done. You should save store object which is returned by CKEDITOR.tools.setTimeout
and cancel timeout execution before resolve
.
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.
Promises should be resilient to such cases, as a single promise cannot be resolved or rejected twice. But as we are using polyfills and cleaning up unnecessary functions is a good practice I add the cleaning up mechanism.
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, you can't resolve/reject promise more than one time or rejected already resolved promise. Still, it's good practise to cleanup code in such cases as above.
I didn't rebase the branch to not lose the comments history. But I check it locally and it rebases without any 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.
Submitting first review part (review still pending).
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.
I only did some minor refactoring in dialog tools. It looks quite impressive and the way how easily we can now test dialogs is really nice, good job 👍
Just some minor polishing in tests left (see #3499 (review)). Also I wonder, do you see in benefit in creating more integrational tests (so testing focus on some real plugins dialogs instead of test dialogs)?
It's a great idea. I tried to do it within this PR, however, I noticed it would require to attach my custom |
Helper improvements and extra unit tests are extracted to #3706. |
… be confusing and replace it with comment in code.
…ly initialized and focus remain on cancel button. Provide config to the test editor to have always the same order of buttons regardles of OS.
Co-Authored-By: Krzysztof Krztoń <[email protected]>
…les to use more types of fileds in dialogs.
Co-Authored-By: Krzysztof Krztoń <[email protected]>
Rebased onto latest |
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, good job 👍
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 is the proposed changelog entry for this pull request?
What changes did you make?
After clicking into the tab in navigation setup a proper focus and state.
There is also some clean up to prevent jshint errors.
Closes: #3474, closes: #3689