Skip to content

Commit

Permalink
#72 Additional accessibility fixes following review.
Browse files Browse the repository at this point in the history
  • Loading branch information
FrenjaminBanklin committed Jul 18, 2023
1 parent 02fb33e commit 37f1870
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/components/player/cell.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class Cell extends React.Component {
{ this.props.showInput ?
<input
type="text"
aria-label={this.state.value != '' ? 'Current cell value: ' + this.state.value : 'This cell is currently blank, please provide a value.'}
id={this.props.inputID}
value={this.state.value}
onChange={this.handleChange}
Expand Down
2 changes: 1 addition & 1 deletion src/components/player/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const fullAriaString = "Secret Spreadsheet widget instructions. " +
"Cells of this spreadsheet have been intentionally hidden. " +
"Navigate the spreadsheet and input the hidden data until all cells have been filled. " +
"Capitalization and punctuation must be precise to match correctly. " +
"Navigate the table using your screen reader's dedicated key bindings, or use the tab key to move between blank cells."
"Navigate the table cells individually using your screen reader's dedicated key bindings, or use the Tab key to move between blank cells."

// popup containing instructions on how to use the wdget
const Popup = props => {
Expand Down
13 changes: 12 additions & 1 deletion src/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ class PlayerApp extends React.Component {
:
<button type="button"
value="Help"
inert={this.state.showQuestion ? 'yes' : undefined}
onClick={this.handlePopupToggle}>
<img src="./assets/img/question-mark.svg" />
Help
Expand All @@ -189,7 +190,10 @@ class PlayerApp extends React.Component {
/>:
null}

<p className="instructions">Input the <span>missing data</span> to complete the spreadsheet:</p>
<p className="instructions"
inert="true">
Input the <span>missing data</span> to complete the spreadsheet:
</p>

<form onSubmit={this.handleSubmit}
inert={this.state.showQuestion || this.state.popup ? 'yes' : undefined}>
Expand Down Expand Up @@ -230,6 +234,13 @@ class PlayerApp extends React.Component {

<input type="submit"
value="Submit"
aria-label={ 'Submit answers.' +
(
this.state.answered !== this.blankPositions.size
? ` Warning, ${this.state.answered} of ${this.blankPositions.size} blank cells have been filled in.`
: ''
)
}
className={this.state.answered !== this.blankPositions.size ? `grayed`:`filled`}
/>
</form>
Expand Down

0 comments on commit 37f1870

Please sign in to comment.