-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added labels and aria properties for username and password input in i…
…dp service
- Loading branch information
JanAckermann
committed
Mar 12, 2021
1 parent
f2dcc93
commit 1a4f8aa
Showing
6 changed files
with
130 additions
and
73 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
changelog/unreleased/add-labels-and-aria-labelled-by-on-login.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Enhancement: Add labels and aria properties for accessibility to input elements on login page | ||
|
||
https://github.com/owncloud/ocis/pull/1794 | ||
https://github.com/owncloud/web/issues/4319 |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,32 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import { useIntl } from 'react-intl'; | ||
import {useIntl} from 'react-intl'; | ||
|
||
const TextInput = (props) => { | ||
const intl = useIntl(); | ||
const intl = useIntl(); | ||
const label = props.label; | ||
const extraClassName = props.extraClassName; | ||
|
||
return <input className="oc-input" {...props} placeholder={props.placeholder ? intl.formatMessage(props.placeholder) : null} />; | ||
delete props.label; | ||
delete props.extraClassName; | ||
|
||
return ( | ||
<div> | ||
<label id={`${props.id}-label`} | ||
className="oc-label" | ||
htmlFor={props.id}>{intl.formatMessage(label)}</label> | ||
<input className={`oc-input ${extraClassName ? extraClassName : ''}`} {...props} | ||
aria-labelledby={`${props.id}-label`} | ||
placeholder={props.placeholder ? intl.formatMessage(props.placeholder) : null}/> | ||
</div>); | ||
}; | ||
|
||
TextInput.propTypes = { | ||
placeholder: PropTypes.object, | ||
placeholder: PropTypes.object, | ||
label: PropTypes.object, | ||
id: PropTypes.string, | ||
extraClassName: props.string, | ||
} | ||
|
||
export default TextInput; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters