remove custom aria prop name

This commit is contained in:
KDSBrowne 2017-05-18 11:38:07 -07:00
parent f6a701b103
commit de6e7093f3
8 changed files with 23 additions and 25 deletions

View File

@ -58,7 +58,7 @@ class ActionsDropdown extends Component {
return (
<Dropdown ref="dropdown">
<DropdownTrigger>
<DropdownTrigger tabIndex={0}>
<Button
label={intl.formatMessage(intlMessages.actionsLabel)}
icon="add"

View File

@ -30,7 +30,7 @@ class EmojiMenu extends Component {
return (
<Dropdown autoFocus={true}>
<DropdownTrigger placeInTabOrder={true}>
<DropdownTrigger tabIndex={0}>
<Button
role="button"
label={intl.formatMessage(intlMessages.statusTriggerLabel)}

View File

@ -51,6 +51,7 @@ const propTypes = {
const defaultProps = {
isOpen: false,
autoFocus: false,
};
class Dropdown extends Component {
@ -128,10 +129,9 @@ class Dropdown extends Component {
const {
children,
className,
style, intl,
hasPopup,
ariaLive,
ariaRelevant,
style,
intl,
...otherProps,
} = this.props;
let trigger = children.find(x => x.type === DropdownTrigger);
@ -154,11 +154,11 @@ class Dropdown extends Component {
return (
<div
style={style}
className={cx(styles.dropdown, className)}
aria-live={ariaLive}
aria-relevant={ariaRelevant}
aria-haspopup={hasPopup}>
style={style}
className={cx(styles.dropdown, className)}
aria-live={otherProps['aria-live']}
aria-relevant={otherProps['aria-relevant']}
aria-haspopup={otherProps['aria-haspopup']}>
{trigger}
{content}
{ this.state.isOpen ?

View File

@ -10,6 +10,9 @@ const propTypes = {
description: PropTypes.string,
};
const defaultProps = {
};
export default class DropdownListItem extends Component {
constructor(props) {
super(props);
@ -29,16 +32,14 @@ export default class DropdownListItem extends Component {
render() {
const { label, description, children, injectRef, tabIndex, onClick, onKeyDown,
className, style, separator, intl, placeInTabOrder, } = this.props;
let index = (placeInTabOrder) ? 0 : -1;
className, style, separator, intl, } = this.props;
return (
<li
ref={injectRef}
onClick={onClick}
onKeyDown={onKeyDown}
tabIndex={index}
tabIndex={tabIndex}
aria-labelledby={this.labelID}
aria-describedby={this.descID}
className={cx(styles.item, className)}
@ -64,3 +65,4 @@ export default class DropdownListItem extends Component {
}
DropdownListItem.propTypes = propTypes;
DropdownListItem.defaultProps = defaultProps;

View File

@ -41,16 +41,14 @@ export default class DropdownTrigger extends Component {
}
render() {
const { children, style, className, placeInTabOrder, } = this.props;
const { children, style, className, tabIndex, } = this.props;
const TriggerComponent = React.Children.only(children);
let index = (placeInTabOrder) ? '0' : '-1';
const TriggerComponentBounded = React.cloneElement(children, {
onClick: this.handleClick,
onKeyDown: this.handleKeyDown,
'aria-haspopup': true,
tabIndex: index,
tabIndex: tabIndex,
style: style,
className: cx(children.props.className, className),
});

View File

@ -84,7 +84,7 @@ class SettingsDropdown extends Component {
return (
<Dropdown autoFocus={true}>
<DropdownTrigger placeInTabOrder={true}>
<DropdownTrigger tabIndex={0}>
<Button
label={intl.formatMessage(intlMessages.optionsLabel)}
icon="more"

View File

@ -84,8 +84,6 @@ class UserList extends Component {
rovingIndex(event, listType) {
const { users, openChats } = this.props;
//console.log(Args);
let active = document.activeElement;
let list;
let items;

View File

@ -289,9 +289,9 @@ class UserListItem extends Component {
onHide={this.onActionsHide}
className={styles.dropdown}
autoFocus={false}
hasPopup="true"
ariaLive="assertive"
ariaRelevant="additions">
aria-haspopup="true"
aria-live="assertive"
aria-relevant="additions">
<DropdownTrigger>
{contents}
</DropdownTrigger>