Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"@ckeditor/ckeditor5-block-quote": "^16.0.0",
"@ckeditor/ckeditor5-editor-balloon": "^16.0.0",
"@ckeditor/ckeditor5-editor-classic": "^16.0.0",
"@ckeditor/ckeditor5-editor-inline": "^16.0.0",
"@ckeditor/ckeditor5-engine": "^16.0.0",
"@ckeditor/ckeditor5-enter": "^16.0.0",
"@ckeditor/ckeditor5-essentials": "^16.0.0",
Expand Down
1 change: 1 addition & 0 deletions src/editableui/editableuiview.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export default class EditableUIView extends View {
this.setTemplate( {
tag: 'div',
attributes: {
tabindex: '0',
class: [
'ck',
'ck-content',
Expand Down
1 change: 1 addition & 0 deletions tests/editableui/editableuiview.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ describe( 'EditableUIView', () => {
expect( view.element.classList.contains( 'ck-rounded-corners' ) ).to.be.true;
expect( view.element.getAttribute( 'lang' ) ).to.equal( 'en' );
expect( view.element.getAttribute( 'dir' ) ).to.equal( 'ltr' );
expect( view.element.getAttribute( 'tabindex' ) ).to.equal( '0' );
expect( view._externalElement ).to.be.undefined;
expect( view.isRendered ).to.be.true;
} );
Expand Down
116 changes: 116 additions & 0 deletions tests/manual/tickets/6200/1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
<button id="btn-readonly">Toggle read-only</button>

<br><br>

<input type="text" value="Focusable input"><br>
<input type="text" value="Focusable input"><br>

<h2>Classic editor</h2>
<div id="editor-classic">
<h2>Appreciation of diversity</h2>
<figure class="image">
<img src="sample.jpg" alt="Sample image">
</figure>
<p>
Getting used to an entirely <a href="https://ckeditor.com">different culture can be challenging</a>. While it’s also nice to learn about
cultures online or from books, nothing comes close to experiencing cultural diversity in person.
</p>
<figure class="table">
<table>
<thead>
<tr>
<th>foo</th>
<th>bar</th>
<th>baz</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
</tbody>
</table>
</figure>
<p>
You learn to appreciate each and every single one of the differences while you become more culturally fluid.
</p>
</div>

<input type="text" value="Focusable input"><br>
<input type="text" value="Focusable input"><br>

<h2>Inline editor</h2>
<div id="editor-inline">
<h2>Appreciation of diversity</h2>
<figure class="image">
<img src="sample.jpg" alt="Sample image">
</figure>
<p>
Getting used to an entirely <a href="https://ckeditor.com">different culture can be challenging</a>. While it’s also nice to learn about
cultures online or from books, nothing comes close to experiencing cultural diversity in person.
</p>
<figure class="table">
<table>
<thead>
<tr>
<th>foo</th>
<th>bar</th>
<th>baz</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
</tbody>
</table>
</figure>
<p>
You learn to appreciate each and every single one of the differences while you become more culturally fluid.
</p>
</div>

<input type="text" value="Focusable input"><br>
<input type="text" value="Focusable input"><br>

<h2>Balloon editor</h2>
<div id="editor-balloon">
<h2>Appreciation of diversity</h2>
<figure class="image">
<img src="sample.jpg" alt="Sample image">
</figure>
<p>
Getting used to an entirely <a href="https://ckeditor.com">different culture can be challenging</a>. While it’s also nice to learn about
cultures online or from books, nothing comes close to experiencing cultural diversity in person.
</p>
<figure class="table">
<table>
<thead>
<tr>
<th>foo</th>
<th>bar</th>
<th>baz</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
</tbody>
</table>
</figure>
<p>
You learn to appreciate each and every single one of the differences while you become more culturally fluid.
</p>
</div>

<br><br>

<input type="text" value="Focusable input"><br>
<input type="text" value="Focusable input">
74 changes: 74 additions & 0 deletions tests/manual/tickets/6200/1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/**
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

/* globals window, document, console:false */

import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
import InlineEditor from '@ckeditor/ckeditor5-editor-inline/src/inlineeditor';
import BalloonEditor from '@ckeditor/ckeditor5-editor-balloon/src/ballooneditor';
import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset';

const EDITOR_CONFIG = {
plugins: [ ArticlePluginSet ],
toolbar: [
'heading',
'|',
'bold',
'italic',
'link',
'|',
'bulletedList',
'numberedList',
'blockQuote',
'insertTable',
'mediaEmbed',
'|',
'undo',
'redo'
],
image: {
toolbar: [ 'imageStyle:full', 'imageStyle:side', '|', 'imageTextAlternative' ]
},
table: {
contentToolbar: [
'tableColumn',
'tableRow',
'mergeTableCells'
]
}
};

ClassicEditor
.create( document.querySelector( '#editor-classic' ), EDITOR_CONFIG )
.then( editor => {
window.classicEditor = editor;
} )
.catch( err => {
console.error( err.stack );
} );

InlineEditor
.create( document.querySelector( '#editor-inline' ), EDITOR_CONFIG )
.then( editor => {
window.inlineEditor = editor;
} )
.catch( err => {
console.error( err.stack );
} );

BalloonEditor
.create( document.querySelector( '#editor-balloon' ), EDITOR_CONFIG )
.then( editor => {
window.balloonEditor = editor;
} )
.catch( err => {
console.error( err.stack );
} );

document.querySelector( '#btn-readonly' ).addEventListener( 'click', () => {
Copy link
Member

Choose a reason for hiding this comment

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

Looks like a problem with indentation here?

Copy link
Member

Choose a reason for hiding this comment

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

Why?

window.classicEditor.isReadOnly = !window.classicEditor.isReadOnly;
window.inlineEditor.isReadOnly = !window.inlineEditor.isReadOnly;
window.balloonEditor.isReadOnly = !window.balloonEditor.isReadOnly;
} );
6 changes: 6 additions & 0 deletions tests/manual/tickets/6200/1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## `tabindex="0"` for editable element [#6200](https://github.com/ckeditor/ckeditor5/issues/6200)

Check if the editor behaves correctly when it comes to:

- focusing order (<kbd>Tab</kbd> and <kbd>Shift + Tab</kbd>),
- focusing editor in read-only mode and editor features.
Binary file added tests/manual/tickets/6200/sample.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.