Skip to content

Commit

Permalink
Fix aria label input component (#916)
Browse files Browse the repository at this point in the history
* If ariaLabel hide label for screen-readers

* Bump version
  • Loading branch information
ssb-cgn committed Nov 30, 2023
1 parent 7a94d38 commit 428b8ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@statisticsnorway/ssb-component-library",
"version": "2.0.95",
"version": "2.0.96",
"description": "Component library for SSB (Statistics Norway)",
"main": "lib/bundle.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Input/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const Input = forwardRef(({

return (
<div className={`ssb-input${negative ? ' negative' : ''}${error ? ' error' : ''}${size === 'lg' ? ' input-lg' : ''}${className ? ` ${className}` : ''}`}>
{label && <label htmlFor={inputId}>{label}</label>}
{label && <label aria-hidden={ariaLabel ? true : undefined} htmlFor={inputId}>{label}</label>}
<div ref={ref} className="input-wrapper" role={searchField ? 'search' : role} aria-label={ariaLabelWrapper}>
<input
id={inputId}
Expand Down

0 comments on commit 428b8ce

Please sign in to comment.