Skip to content
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

Add input as focusable element inside panels #2457

Merged
merged 12 commits into from Oct 12, 2018
Merged

Add input as focusable element inside panels #2457

merged 12 commits into from Oct 12, 2018

Conversation

msamsel
Copy link
Contributor

@msamsel msamsel commented Oct 4, 2018

What is the purpose of this pull request?

New feature

This PR contains

  • Unit tests
  • Manual tests

What changes did you make?

Close #2453

@mlewand mlewand self-requested a review October 4, 2018 10:12
@mlewand
Copy link
Contributor

mlewand commented Oct 8, 2018

@msamsel Please add reference to the issue that is closed by this PR.

Copy link
Contributor

@mlewand mlewand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor things.

@@ -381,7 +381,7 @@
// Move forward.
case 'next':
var index = this._.focusIndex,
links = this.element.getElementsByTag( 'a' ),
links = this._.getItems(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are no longer links. We should refer to this in a more generic way, like "focusables".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This problem is repeated in couple other places.

@@ -361,7 +361,7 @@
* @returns {*|CKEDITOR.dom.nodeList}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This format is wrong. It will always return CKEDITOR.dom.nodeList, so please use this opportunity to adjust the API docs.

@@ -0,0 +1,14 @@
@bender-tags: 4.11.0, feature, 2453
@bender-ui: collapsed
@bender-ckeditor-plugins: wysiwygarea,toolbar,panel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add space between the comma separated values just like you did for tags.

* You can acess to `input` element with <kbd>TAB</kbd> key.

### Unexpected:
* Input element is noto focusable with keyboard.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo, not focusable.

Copy link
Contributor

@mlewand mlewand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix looks OK, couple of stylistic issues. I'll fix them with review to speed things up.

And good job with the manual test, looks much better.

}
} );
}
} )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

} );
}
} )
var editor = CKEDITOR.replace( 'editor', {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable is not used anywhere else. It is not needed.

editor.ui.add( 'testplugin', CKEDITOR.UI_PANELBUTTON, {
label: 'test',
title: 'Test Panel',
modes: { wysiwyg: 1 },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-empty literal objects should not be written in a single line.

CHANGES.md Outdated
@@ -12,6 +12,7 @@ New Features:
* [#706](https://github.com/ckeditor/ckeditor-dev/issues/706): Added different cursor style when selecting cells for [Table Selection](https://ckeditor.com/cke4/addon/tableselection) plugin.
* [#651](https://github.com/ckeditor/ckeditor-dev/issues/651): Text pasted using [Paste from Word](https://ckeditor.com/cke4/addon/pastefromword) preservers indentation in paragraphs.
* [#1176](https://github.com/ckeditor/ckeditor-dev/pull/1176): The [Balloon Panel](https://ckeditor.com/cke4/addon/balloonpanel) can be attached to selection instead of element.
* [#2453](https://github.com/ckeditor/ckeditor-dev/pull/2453): Add possibility to focus on `input` elements within [Panels](https://ckeditor.com/cke4/addon/panel).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is marked as an API change, and should be placed in API changes section.

CHANGES.md Outdated
@@ -12,6 +12,7 @@ New Features:
* [#706](https://github.com/ckeditor/ckeditor-dev/issues/706): Added different cursor style when selecting cells for [Table Selection](https://ckeditor.com/cke4/addon/tableselection) plugin.
* [#651](https://github.com/ckeditor/ckeditor-dev/issues/651): Text pasted using [Paste from Word](https://ckeditor.com/cke4/addon/pastefromword) preservers indentation in paragraphs.
* [#1176](https://github.com/ckeditor/ckeditor-dev/pull/1176): The [Balloon Panel](https://ckeditor.com/cke4/addon/balloonpanel) can be attached to selection instead of element.
* [#2453](https://github.com/ckeditor/ckeditor-dev/pull/2453): Add possibility to focus on `input` elements within [Panels](https://ckeditor.com/cke4/addon/panel).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong link. I can see the reason why it happened - you mad a copy'n'paste from the line above which introduced this issue. Always double check copied things.

var links = this.element.getElementsByTag( 'a' );
var item = links.getItem( this._.focusIndex = index );
var focusables = this._.getItems();
var item = focusables.getItem( this._.focusIndex = index );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could join these two subsequent var statements, as this is our code style since couple of years.

@@ -23,6 +38,19 @@
src = src.substring( 5, src.length - 1 );

assert.areSame( '', src, 'Frame source should be empty.' );
},

// #2453
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More commonly we put issue references in parenthesis.

@mlewand mlewand self-requested a review October 12, 2018 08:25
Copy link
Contributor

@mlewand mlewand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks OK now.

@mlewand
Copy link
Contributor

mlewand commented Oct 12, 2018

I have rebased the branch before merge.

@mlewand mlewand merged commit 1a72d17 into major Oct 12, 2018
@CKEditorBot CKEditorBot deleted the t/2453 branch October 12, 2018 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants