Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Other: Renamed a misspelled InputTextViewariaDesribedById property …
Browse files Browse the repository at this point in the history
…to `InputTextView#ariaDescribedById`. Closes #483.

BREAKING CHANGE: The `InputTextView#ariaDesribedById` property is no longer available. Use `ariaDescribedById` instead.
  • Loading branch information
oleq committed Apr 19, 2019
1 parent b2dcebe commit 2288bf3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/inputtext/inputtextview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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' )
Expand Down
2 changes: 1 addition & 1 deletion src/labeledinput/labeledinputview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
8 changes: 4 additions & 4 deletions tests/inputtext/inputtextview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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 );
} );
} );

Expand Down
2 changes: 1 addition & 1 deletion tests/labeledinput/labeledinputview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
} );
} );

Expand Down

0 comments on commit 2288bf3

Please sign in to comment.