Преглед на файлове

Allow to set focus outside the editor when there are no exceptions after/before

panr преди 6 години
родител
ревизия
74e79c8697
променени са 1 файла, в които са добавени 6 реда и са изтрити 0 реда
  1. 6 0
      packages/ckeditor5-restricted-editing/src/restrictededitingmodeediting.js

+ 6 - 0
packages/ckeditor5-restricted-editing/src/restrictededitingmodeediting.js

@@ -186,6 +186,7 @@ export default class RestrictedEditingModeEditing extends Plugin {
 
 		// The restricted editing might be configured without input support - ie allow only bolding or removing text.
 		// This check is bit synthetic since only tests are used this way.
+
 		if ( inputCommand ) {
 			this.listenTo( inputCommand, 'execute', disallowInputExecForWrongRange( editor ), { priority: 'high' } );
 		}
@@ -282,9 +283,14 @@ export default class RestrictedEditingModeEditing extends Plugin {
 function getCommandExecuter( editor, commandName ) {
 	return ( data, cancel ) => {
 		const command = editor.commands.get( commandName );
+		const navigationCommands = commandName === 'goToPreviousRestrictedEditingException' ||
+			commandName === 'goToNextRestrictedEditingException';
 
 		if ( command.isEnabled ) {
 			editor.execute( commandName );
+		} else if ( navigationCommands ) {
+			// Allows to set focus on elements outside of the editable if commands are disabled
+			return;
 		}
 
 		cancel();