Skip to content

Commit

Permalink
Add aria-labels to all input elements without a label to address #140
Browse files Browse the repository at this point in the history
…and #141
  • Loading branch information
nai888 committed Jan 4, 2019
1 parent ce65ab8 commit 0e06d1f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The format of this changelog is based on [Keep a Changelog](https://keepachangel

- Add option to choose whether to italicize changed results.
- Reformat the MorphForm controls to save space.
- Add aria-labels to all input elements without a label. (See [issue #141](https://github.com/nai888/langua/issues/141).)

### Changed 0.4.2

Expand Down
7 changes: 7 additions & 0 deletions src/routes/Deriv/DerivForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const DerivForm = props => {
className={props.styles.lexemeInput}
value={lexeme.lexeme}
onChange={props.change}
aria-label={`Word for lexeme ${index}`}
/>
<input
type='text'
Expand All @@ -30,6 +31,7 @@ const DerivForm = props => {
className={props.styles.lexemeDefInput}
value={lexeme.definition}
onChange={props.change}
aria-label={`Gloss for lexeme ${index}`}
/>
<div className={props.styles.clearButton}>
<Button
Expand All @@ -38,6 +40,7 @@ const DerivForm = props => {
ver='danger'
addClass='small'
type='button'
aria-label={`Delete lexeme ${index}`}
>
Delete
</Button>
Expand All @@ -54,6 +57,7 @@ const DerivForm = props => {
className={props.styles.derivationInput}
value={derivation.derivation}
onChange={props.change}
aria-label={`Affix ${index}`}
/>
<input
type='text'
Expand All @@ -62,6 +66,7 @@ const DerivForm = props => {
className={props.styles.derivationGlossInput}
value={derivation.gloss}
onChange={props.change}
aria-label={`Gloss for affix ${index}`}
/>
<input
type='text'
Expand All @@ -70,6 +75,7 @@ const DerivForm = props => {
className={props.styles.derivationDefInput}
value={derivation.definition}
onChange={props.change}
aria-label={`Definition for affix ${index}`}
/>
<div className={props.styles.clearButton}>
<Button
Expand All @@ -78,6 +84,7 @@ const DerivForm = props => {
ver='danger'
addClass='small'
type='button'
aria-label={`Delete lexeme ${index}`}
>
Delete
</Button>
Expand Down
3 changes: 3 additions & 0 deletions src/routes/Frequen/FrequenForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const FrequenForm = props => {
name='corpus'
value={props.state.corpus}
onChange={props.onChangeInput}
aria-label='Text corpus'
/>
</div>
<div className={classNames(props.styles.consonants, props.classes.part)}>
Expand All @@ -40,6 +41,7 @@ const FrequenForm = props => {
type='text'
value={props.state.consonants}
onChange={props.onChangeInput}
aria-label='Consonants'
/>
</div>
<div className={classNames(props.styles.vowels, props.classes.part)}>
Expand All @@ -51,6 +53,7 @@ const FrequenForm = props => {
type='text'
value={props.state.vowels}
onChange={props.onChangeInput}
aria-label='Vowels'
/>
</div>
<Control addedClasses={props.classes.part}>
Expand Down
6 changes: 6 additions & 0 deletions src/routes/Gen/GenForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const GenForm = props => {
value={subpattern.selected}
onChange={props.change}
className={props.styles.select}
aria-label={`Variable name for subpattern ${index}`}
>
{selectOptions}
</select>
Expand All @@ -39,6 +40,7 @@ const GenForm = props => {
className={props.styles.subpatternInput}
value={subpattern.subpattern}
onChange={props.change}
aria-label={`Subpattern ${index}`}
/>
<div className={props.styles.clearButton}>
<Button
Expand All @@ -47,6 +49,7 @@ const GenForm = props => {
ver='danger'
addClass='small'
type='button'
aria-label={`Delete subpattern ${index}`}
>
Delete
</Button>
Expand All @@ -64,6 +67,7 @@ const GenForm = props => {
ver='success'
addClass='small'
type='button'
aria-label='Add a new subpattern'
>
Add
</Button>
Expand Down Expand Up @@ -94,6 +98,7 @@ const GenForm = props => {
className={props.styles.patternInput}
value={props.data.pattern}
onChange={props.change}
aria-label='Pattern'
/>
</div>
<Control addedClasses={props.classes.part}>
Expand All @@ -119,6 +124,7 @@ const GenForm = props => {
className={props.styles.wordsInput}
value={props.data.words}
onChange={props.change}
aria-label='Number of words to generate'
/>
</ControlPiece>
<ControlPiece>
Expand Down
4 changes: 4 additions & 0 deletions src/routes/Morph/MorphForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const MorphForm = props => {
)}
value={join(props.data.categories)}
onChange={props.change}
aria-label='Categories'
/>
<div className={props.styles.textAreaSpacer}>
{join(props.data.categories)}
Expand All @@ -67,6 +68,7 @@ const MorphForm = props => {
)}
value={join(props.data.rewriteRules)}
onChange={props.change}
aria-label='Rewrite rules'
/>
<div className={props.styles.textAreaSpacer}>
{join(props.data.rewriteRules)}
Expand All @@ -92,6 +94,7 @@ const MorphForm = props => {
)}
value={join(props.data.soundChanges)}
onChange={props.change}
aria-label='Sound Changes'
/>
<div className={props.styles.textAreaSpacer}>
{join(props.data.soundChanges)}
Expand All @@ -117,6 +120,7 @@ const MorphForm = props => {
)}
value={join(props.data.lexicon)}
onChange={props.change}
aria-label='Lexicon'
/>
<div className={props.styles.textAreaSpacer}>
{join(props.data.lexicon)}
Expand Down

0 comments on commit 0e06d1f

Please sign in to comment.