Skip to content

Commit

Permalink
fix(InputField) - adds aria-label property on input element (carbon…
Browse files Browse the repository at this point in the history
…-design-system#2262)

* fix: adds property ariaLabel

* fix: adds ariaLabel into the label of the inout

* fix: typo

* fix: adds aria-label on input and not on label
  • Loading branch information
paschalidi authored and asudoh committed Apr 23, 2019
1 parent bda3016 commit 953b870
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/NumberInput/NumberInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ class NumberInput extends Component {
* Provide text that is used alongside the control label for additional help
*/
helperText: PropTypes.node,
/**
* Provide a description that would be used to best describe the use case of the NumberInput component
*/
ariaLabel: PropTypes.string,
/**
* `true` to use the light version.
*/
Expand Down Expand Up @@ -131,6 +135,7 @@ class NumberInput extends Component {
value: 0,
invalid: false,
invalidText: 'Provide invalidText',
ariaLabel: 'Numeric input field with increment and decrement buttons',
helperText: '',
light: false,
allowEmpty: false,
Expand Down Expand Up @@ -217,6 +222,7 @@ class NumberInput extends Component {
invalid,
invalidText,
helperText,
ariaLabel,
light,
allowEmpty,
innerRef: ref,
Expand All @@ -243,6 +249,7 @@ class NumberInput extends Component {
step,
onChange: this.handleChange,
value: this.state.value,
ariaLabel,
};

const buttonProps = {
Expand Down

0 comments on commit 953b870

Please sign in to comment.