This repository was archived by the owner on Jun 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Added tabindex="0" to editable element to make it focusable in read-only mode
#540
Open
scofalik
wants to merge
3
commits into
master
Choose a base branch
from
i/6200
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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', () => { | ||
| window.classicEditor.isReadOnly = !window.classicEditor.isReadOnly; | ||
| window.inlineEditor.isReadOnly = !window.inlineEditor.isReadOnly; | ||
| window.balloonEditor.isReadOnly = !window.balloonEditor.isReadOnly; | ||
| } ); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 like a problem with indentation here?
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.
Why?