@@ -8,10 +8,9 @@ const setInputType = (type: string, element: HTMLDivElement | null) => {
88 element ?. getElementsByTagName ( "input" ) [ 0 ] ?. setAttribute ( "type" , type ) ;
99} ;
1010
11- const setAriaAttributes = ( ariaExpanded : "true" | "false" , ariaLabel : string , element : HTMLDivElement | null ) => {
11+ const setAriaAttributes = ( ariaExpanded : "true" | "false" , element : HTMLDivElement | null ) => {
1212 const buttonElement = element ?. getElementsByTagName ( "button" ) [ 0 ] ;
1313 buttonElement ?. setAttribute ( "aria-expanded" , ariaExpanded ) ;
14- buttonElement ?. setAttribute ( "aria-label" , ariaLabel ) ;
1514} ;
1615
1716const DxcPasswordInput = forwardRef < RefType , PasswordInputPropsType > (
@@ -32,6 +31,7 @@ const DxcPasswordInput = forwardRef<RefType, PasswordInputPropsType>(
3231 margin,
3332 size = "medium" ,
3433 tabIndex = 0 ,
34+ ariaLabel = "Password input" ,
3535 } ,
3636 ref
3737 ) => {
@@ -44,12 +44,12 @@ const DxcPasswordInput = forwardRef<RefType, PasswordInputPropsType>(
4444 if ( isPasswordVisible ) {
4545 setInputType ( "text" , inputRef . current ) ;
4646 if ( passwordInput . inputHidePasswordTitle ) {
47- setAriaAttributes ( "true" , passwordInput . inputHidePasswordTitle , inputRef . current ) ;
47+ setAriaAttributes ( "true" , inputRef . current ) ;
4848 }
4949 } else {
5050 setInputType ( "password" , inputRef . current ) ;
5151 if ( passwordInput . inputShowPasswordTitle ) {
52- setAriaAttributes ( "false" , passwordInput . inputShowPasswordTitle , inputRef . current ) ;
52+ setAriaAttributes ( "false" , inputRef . current ) ;
5353 }
5454 }
5555 } ) ( ) ;
@@ -81,6 +81,7 @@ const DxcPasswordInput = forwardRef<RefType, PasswordInputPropsType>(
8181 autocomplete = { autocomplete }
8282 ref = { inputRef }
8383 tabIndex = { tabIndex }
84+ ariaLabel = { ariaLabel }
8485 />
8586 </ PasswordInput >
8687 ) ;
0 commit comments