From d0f600ed461cc3d3fbe839113de5e7080a5bb412 Mon Sep 17 00:00:00 2001 From: fredck Date: Wed, 29 May 2013 13:00:45 +0200 Subject: [PATCH 1/2] Set the focus to the list holder element when opening a toolbar combo. --- plugins/listblock/plugin.js | 21 ++++++++++++--------- plugins/panel/plugin.js | 3 ++- plugins/richcombo/plugin.js | 4 ++-- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/plugins/listblock/plugin.js b/plugins/listblock/plugin.js index f44c37f195f..1ebe450bf41 100644 --- a/plugins/listblock/plugin.js +++ b/plugins/listblock/plugin.js @@ -205,12 +205,13 @@ CKEDITOR.plugins.add( 'listblock', { focus: function( value ) { this._.focusIndex = -1; - if ( value ) { - var selected = this.element.getDocument().getById( this._.items[ value ] ).getFirst(); + var links = this.element.getElementsByTag( 'a' ), + link, + selected, + i = -1; - var links = this.element.getElementsByTag( 'a' ), - link, - i = -1; + if ( value ) { + selected = this.element.getDocument().getById( this._.items[ value ] ).getFirst(); while ( ( link = links.getItem( ++i ) ) ) { if ( link.equals( selected ) ) { @@ -218,11 +219,13 @@ CKEDITOR.plugins.add( 'listblock', { break; } } - - setTimeout( function() { - selected.focus(); - }, 0 ); + } else { + this.element.focus(); } + + selected && setTimeout( function() { + selected.focus(); + }, 0 ); } } }); diff --git a/plugins/panel/plugin.js b/plugins/panel/plugin.js index 61067b69978..5188b7e2f92 100644 --- a/plugins/panel/plugin.js +++ b/plugins/panel/plugin.js @@ -267,7 +267,8 @@ attributes: { 'tabIndex': -1, 'class': 'cke_panel_block', - 'role': 'presentation' + 'role': 'presentation', + 'tabindex': 0 }, styles: { display: 'none' diff --git a/plugins/richcombo/plugin.js b/plugins/richcombo/plugin.js index 28284b4093e..6310e40b143 100644 --- a/plugins/richcombo/plugin.js +++ b/plugins/richcombo/plugin.js @@ -249,14 +249,14 @@ CKEDITOR.plugins.add( 'richcombo', { me.setState( CKEDITOR.TRISTATE_ON ); - list.focus( !list.multiSelect && me.getValue() ); - me._.on = 1; me.editorFocus && editor.focus(); if ( me.onOpen ) me.onOpen(); + + list.focus( !list.multiSelect && me.getValue() ); }; panel.onHide = function( preventOnClose ) { From a5cfb69e43001216f47234ed8ab662aee830c13f Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Wed, 29 May 2013 16:03:17 +0200 Subject: [PATCH 2/2] Changelog entry. --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 5296fef8da3..f0632f83fc0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,6 +13,7 @@ CKEditor 4 Changelog * [#10298](http://dev.ckeditor.com/ticket/10298): Data processor breaks attributes containing protected parts. * [#9945](http://dev.ckeditor.com/ticket/9945): [iOS] Scrolling not possible on iPad. * [#10165](http://dev.ckeditor.com/ticket/10165): [IE] Access denied error if document.domain has been altered. +* [#10361](http://dev.ckeditor.com/ticket/10361): ARIA role="application" should not be used for floating panels. ## CKEditor 4.1.1