浏览代码

Made the TextAlternativeFormView focusable to allow better Esc key support.

Aleksander Nowodzinski 8 年之前
父节点
当前提交
aa3455bf66

+ 4 - 1
packages/ckeditor5-image/src/imagetextalternative/ui/textalternativeformview.js

@@ -115,7 +115,10 @@ export default class TextAlternativeFormView extends View {
 			attributes: {
 				class: [
 					'cke-text-alternative-form',
-				]
+				],
+
+				// https://github.com/ckeditor/ckeditor5-image/issues/40
+				tabindex: '-1'
 			},
 
 			children: [

+ 1 - 0
packages/ckeditor5-image/tests/imagetextalternative/ui/textalternativeformview.js

@@ -28,6 +28,7 @@ describe( 'TextAlternativeFormView', () => {
 	describe( 'constructor()', () => {
 		it( 'should create element from template', () => {
 			expect( view.element.classList.contains( 'cke-text-alternative-form' ) ).to.be.true;
+			expect( view.element.getAttribute( 'tabindex' ) ).to.equal( '-1' );
 		} );
 
 		it( 'should create #focusTracker instance', () => {

+ 5 - 0
packages/ckeditor5-image/theme/imagetextalternative/theme.scss

@@ -8,6 +8,11 @@
 		padding: ck-spacing( 'large' );
 		overflow: hidden;
 
+		&:focus {
+			// https://github.com/ckeditor/ckeditor5-image/issues/40
+			outline: none;
+		}
+
 		.ck-label {
 			margin-bottom: ck-spacing( 'small' );
 		}