Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Fix: Esc key should close the link panel even if none of the `LinkFor…
Browse files Browse the repository at this point in the history
…mView` fields is focused. Closes #90.

t/90: Esc key should close the link panel even if none of the form fields is focused
  • Loading branch information
oskarwrobel committed Apr 24, 2017
2 parents 686e625 + 20e451f commit 866fa49
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ui/linkformview.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,10 @@ export default class LinkFormView extends View {
attributes: {
class: [
'ck-link-form',
]
],

// https://github.com/ckeditor/ckeditor5-link/issues/90
tabindex: '-1'
},

children: [
Expand Down
1 change: 1 addition & 0 deletions tests/ui/linkformview.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ describe( 'LinkFormView', () => {
describe( 'constructor()', () => {
it( 'should create element from template', () => {
expect( view.element.classList.contains( 'ck-link-form' ) ).to.true;
expect( view.element.getAttribute( 'tabindex' ) ).to.equal( '-1' );
} );

it( 'should create child views', () => {
Expand Down
5 changes: 5 additions & 0 deletions theme/components/linkform.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
padding: ck-spacing( 'large' );
overflow: hidden;

&:focus {
// https://github.com/ckeditor/ckeditor5-link/issues/90
outline: none;
}

.ck-label {
margin-bottom: ck-spacing( 'small' );
}
Expand Down

0 comments on commit 866fa49

Please sign in to comment.