Skip to content

Commit d0f600e

Browse files
fredckoleq
authored andcommitted
Set the focus to the list holder element when opening a toolbar combo.
1 parent 70fbb8d commit d0f600e

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

plugins/listblock/plugin.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -205,24 +205,27 @@ CKEDITOR.plugins.add( 'listblock', {
205205
focus: function( value ) {
206206
this._.focusIndex = -1;
207207

208-
if ( value ) {
209-
var selected = this.element.getDocument().getById( this._.items[ value ] ).getFirst();
208+
var links = this.element.getElementsByTag( 'a' ),
209+
link,
210+
selected,
211+
i = -1;
210212

211-
var links = this.element.getElementsByTag( 'a' ),
212-
link,
213-
i = -1;
213+
if ( value ) {
214+
selected = this.element.getDocument().getById( this._.items[ value ] ).getFirst();
214215

215216
while ( ( link = links.getItem( ++i ) ) ) {
216217
if ( link.equals( selected ) ) {
217218
this._.focusIndex = i;
218219
break;
219220
}
220221
}
221-
222-
setTimeout( function() {
223-
selected.focus();
224-
}, 0 );
222+
} else {
223+
this.element.focus();
225224
}
225+
226+
selected && setTimeout( function() {
227+
selected.focus();
228+
}, 0 );
226229
}
227230
}
228231
});

plugins/panel/plugin.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,8 @@
267267
attributes: {
268268
'tabIndex': -1,
269269
'class': 'cke_panel_block',
270-
'role': 'presentation'
270+
'role': 'presentation',
271+
'tabindex': 0
271272
},
272273
styles: {
273274
display: 'none'

plugins/richcombo/plugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,14 +249,14 @@ CKEDITOR.plugins.add( 'richcombo', {
249249

250250
me.setState( CKEDITOR.TRISTATE_ON );
251251

252-
list.focus( !list.multiSelect && me.getValue() );
253-
254252
me._.on = 1;
255253

256254
me.editorFocus && editor.focus();
257255

258256
if ( me.onOpen )
259257
me.onOpen();
258+
259+
list.focus( !list.multiSelect && me.getValue() );
260260
};
261261

262262
panel.onHide = function( preventOnClose ) {

0 commit comments

Comments
 (0)