Skip to content

Commit

Permalink
Merge pull request desktop#19684 from desktop/ignore-text-area-aria-l…
Browse files Browse the repository at this point in the history
…abelling

Ignore Files text area aria labelling
  • Loading branch information
tidy-dev authored Dec 11, 2024
2 parents cf2cff2 + 59bbb21 commit 1a8a45f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions app/src/ui/lib/text-area.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ interface ITextAreaProps {

/** A callback to receive the underlying `textarea` instance. */
readonly onTextAreaRef?: (instance: HTMLTextAreaElement | null) => void

/** Optional aria-label attribute */
readonly ariaLabel?: string

/** Optional aria-describedby attribute - usually for associating a descriptive
* message to the input such as a validation error, warning, or caption */
readonly ariaDescribedBy?: string
}

/** A textarea element with app-standard styles. */
Expand Down Expand Up @@ -84,6 +91,8 @@ export class TextArea extends React.Component<ITextAreaProps, {}> {
onKeyDown={this.props.onKeyDown}
ref={this.props.onTextAreaRef}
onContextMenu={this.onContextMenu}
aria-label={this.props.ariaLabel}
aria-describedby={this.props.ariaDescribedBy}
/>
</label>
)
Expand Down
4 changes: 3 additions & 1 deletion app/src/ui/repository-settings/git-ignore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class GitIgnore extends React.Component<IGitIgnoreProps, {}> {
public render() {
return (
<DialogContent>
<p>
<p id="ignored-files-description">
Editing <Ref>.gitignore</Ref>. This file specifies intentionally
untracked files that Git should ignore. Files already tracked by Git
are not affected.{' '}
Expand All @@ -25,6 +25,8 @@ export class GitIgnore extends React.Component<IGitIgnoreProps, {}> {
</p>

<TextArea
ariaLabel="Ignored files"
ariaDescribedBy="ignored-files-description"
placeholder="Ignored files"
value={this.props.text || ''}
onValueChanged={this.props.onIgnoreTextChanged}
Expand Down

0 comments on commit 1a8a45f

Please sign in to comment.