浏览代码

Other: Renamed a misspelled `InputTextViewariaDesribedById` property to `InputTextView#ariaDescribedById`. Closes #483.

BREAKING CHANGE: The `InputTextView#ariaDesribedById` property is no longer available. Use `ariaDescribedById` instead.
Aleksander Nowodzinski 6 年之前
父节点
当前提交
adeecdd18d

+ 3 - 3
packages/ckeditor5-ui/src/inputtext/inputtextview.js

@@ -68,9 +68,9 @@ export default class InputTextView extends View {
 		 * some error, it helps screen readers read the error text.
 		 *
 		 * @observable
-		 * @member {Boolean} #ariaDesribedById
+		 * @member {Boolean} #ariaDescribedById
 		 */
-		this.set( 'ariaDesribedById' );
+		this.set( 'ariaDescribedById' );
 
 		const bind = this.bindTemplate;
 
@@ -88,7 +88,7 @@ export default class InputTextView extends View {
 				placeholder: bind.to( 'placeholder' ),
 				readonly: bind.to( 'isReadOnly' ),
 				'aria-invalid': bind.if( 'hasError', true ),
-				'aria-describedby': bind.to( 'ariaDesribedById' )
+				'aria-describedby': bind.to( 'ariaDescribedById' )
 			},
 			on: {
 				input: bind.to( 'input' )

+ 1 - 1
packages/ckeditor5-ui/src/labeledinput/labeledinputview.js

@@ -175,7 +175,7 @@ export default class LabeledInputView extends View {
 		const inputView = new InputView( this.locale, statusUid );
 
 		inputView.id = inputUid;
-		inputView.ariaDesribedById = statusUid;
+		inputView.ariaDescribedById = statusUid;
 		inputView.bind( 'value' ).to( this );
 		inputView.bind( 'isReadOnly' ).to( this );
 		inputView.bind( 'hasError' ).to( this, 'errorText', value => !!value );

+ 4 - 4
packages/ckeditor5-ui/tests/inputtext/inputtextview.js

@@ -8,10 +8,10 @@
 import InputTextView from '../../src/inputtext/inputtextview';
 
 describe( 'InputTextView', () => {
-	let view, ariaDesribedById;
+	let view, ariaDescribedById;
 
 	beforeEach( () => {
-		ariaDesribedById = 'ck-error-1234567890';
+		ariaDescribedById = 'ck-error-1234567890';
 		view = new InputTextView();
 
 		view.render();
@@ -126,9 +126,9 @@ describe( 'InputTextView', () => {
 			it( 'should react on view#hasError', () => {
 				expect( view.element.getAttribute( 'aria-describedby' ) ).to.be.null;
 
-				view.ariaDesribedById = ariaDesribedById;
+				view.ariaDescribedById = ariaDescribedById;
 
-				expect( view.element.getAttribute( 'aria-describedby' ) ).to.equal( ariaDesribedById );
+				expect( view.element.getAttribute( 'aria-describedby' ) ).to.equal( ariaDescribedById );
 			} );
 		} );
 

+ 1 - 1
packages/ckeditor5-ui/tests/labeledinput/labeledinputview.js

@@ -53,7 +53,7 @@ describe( 'LabeledInputView', () => {
 		} );
 
 		it( 'should pair #inputView and #statusView by unique id', () => {
-			expect( view.inputView.ariaDesribedById ).to.equal( view.statusView.element.id );
+			expect( view.inputView.ariaDescribedById ).to.equal( view.statusView.element.id );
 		} );
 	} );