diff --git a/bigbluebutton-html5/imports/ui/components/actions-bar/emoji-menu/component.jsx b/bigbluebutton-html5/imports/ui/components/actions-bar/emoji-menu/component.jsx index 4fc25e4083..34dd61eb1c 100755 --- a/bigbluebutton-html5/imports/ui/components/actions-bar/emoji-menu/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/actions-bar/emoji-menu/component.jsx @@ -18,7 +18,94 @@ const propTypes = { class EmojiMenu extends Component { constructor(props) { super(props); + + // this.rovingIndex = this.rovingIndex.bind(this); } +/* + rovingIndex(...Args) { + const {users, openChats} = this.props; + let active = document.activeElement; + let list; + let items; + let count; + + function focusList() { + active.tabIndex = -1; + this.counter = 0; + list.tabIndex = 0; + list.focus(); + } + + if (Args[1] === 'users'){ + list = findDOMNode(this.refs.usersList); + items = findDOMNode(this.refs.userItems); + count = users.length; + }else if(Args[1] === 'messages'){ + list = findDOMNode(this.refs.msgList); + items = findDOMNode(this.refs.msgItems); + count = openChats.length; + } + + if(this.counter === -1 || this.counter > count){ + active.tabIndex = -1; + list.tabIndex = 0; + this.counter = 0; + list.focus(); + } + + if (Args[0].keyCode === KEY_CODES.ENTER + || Args[0].keyCode === KEY_CODES.ARROW_RIGHT + || Args[0].keyCode === KEY_CODES.ARROW_LEFT) { + active.firstChild.click(); + } + + if (Args[0].keyCode === KEY_CODES.ESCAPE) { + active.tabIndex = -1; + focusList(); + } + + if (Args[0].keyCode === KEY_CODES.ARROW_DOWN) { + if (this.counter < count) { + active.tabIndex = -1; + items.childNodes[this.counter].tabIndex = 0; + let newFocus = items.childNodes[this.counter]; + this.counter++; + newFocus.focus(); + }else if(this.counter === count){ + active.tabIndex = -1; + this.counter = -1; + list.tabIndex = 0; + list.focus(); + }else if(this.counter === 0) { + active.tabIndex = -1; + this.counter = 1; + items.childNodes[this.counter].tabIndex = 0; + let newFocus = items.childNodes[this.counter]; + newFocus.focus(); + } + } + + if (Args[0].keyCode === KEY_CODES.ARROW_UP) { + if (this.counter < count && this.counter !== 0) { + active.tabIndex = -1; + this.counter--; + items.childNodes[this.counter].tabIndex = 0; + let newFocus = items.childNodes[this.counter]; + newFocus.focus(); + }else if(this.counter === 0){ + active.tabIndex = -1; + this.counter = count; + list.tabIndex = 0; + list.focus(); + }else if (this.counter === count){ + active.tabIndex = -1; + this.counter = count - 1; + items.childNodes[this.counter].tabIndex = 0; + let newFocus = items.childNodes[this.counter]; + newFocus.focus(); + } + } + } */ render() { const { @@ -29,7 +116,7 @@ class EmojiMenu extends Component { return ( - + - + actions.setEmojiHandler('raiseHand')} + tabIndex={-1} /> actions.setEmojiHandler('happy')} + tabIndex={-1} /> actions.setEmojiHandler('neutral')} + tabIndex={-1} /> actions.setEmojiHandler('sad')} + tabIndex={-1} /> actions.setEmojiHandler('confused')} + tabIndex={-1} /> actions.setEmojiHandler('away')} + tabIndex={-1} /> actions.setEmojiHandler('thumbsUp')} + tabIndex={-1} /> actions.setEmojiHandler('thumbsDown')} + tabIndex={-1} /> actions.setEmojiHandler('applause')} + tabIndex={-1} /> actions.setEmojiHandler('none')} + tabIndex={-1} /> diff --git a/bigbluebutton-html5/imports/ui/components/dropdown/list/component.jsx b/bigbluebutton-html5/imports/ui/components/dropdown/list/component.jsx index bb4bc16d27..b6349a23d3 100755 --- a/bigbluebutton-html5/imports/ui/components/dropdown/list/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/dropdown/list/component.jsx @@ -60,30 +60,30 @@ export default class DropdownList extends Component { return event.currentTarget.click(); } - //let nextActiveItemIndex = null; + let nextActiveItemIndex = null; - //if (KEY_CODES.ARROW_UP === event.which) { - // nextActiveItemIndex = activeItemIndex - 1; - //} + if (KEY_CODES.ARROW_UP === event.which) { + nextActiveItemIndex = activeItemIndex - 1; + } - //if (KEY_CODES.ARROW_DOWN === event.which) { - // nextActiveItemIndex = activeItemIndex + 1; - //} + if (KEY_CODES.ARROW_DOWN === event.which) { + nextActiveItemIndex = activeItemIndex + 1; + } - //if (nextActiveItemIndex > (this.childrenRefs.length - 1)) { - // nextActiveItemIndex = 0; - //} + if (nextActiveItemIndex > (this.childrenRefs.length - 1)) { + nextActiveItemIndex = 0; + } - //if (nextActiveItemIndex < 0) { - // nextActiveItemIndex = this.childrenRefs.length - 1; - //} + if (nextActiveItemIndex < 0) { + nextActiveItemIndex = this.childrenRefs.length - 1; + } - //if ([KEY_CODES.TAB, KEY_CODES.ESCAPE].includes(event.which)) { - // nextActiveItemIndex = 0; - // dropdownHide(); - //} + if ([KEY_CODES.ESCAPE].includes(event.which)) { + nextActiveItemIndex = 0; + dropdownHide(); + } - //this.setState({ activeItemIndex: nextActiveItemIndex }); + this.setState({ activeItemIndex: nextActiveItemIndex }); if (typeof callback === 'function') { callback(event); diff --git a/bigbluebutton-html5/imports/ui/components/dropdown/list/item/component.jsx b/bigbluebutton-html5/imports/ui/components/dropdown/list/item/component.jsx index 369904192a..5c4651d89e 100755 --- a/bigbluebutton-html5/imports/ui/components/dropdown/list/item/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/dropdown/list/item/component.jsx @@ -29,14 +29,16 @@ export default class DropdownListItem extends Component { render() { const { label, description, children, injectRef, tabIndex, onClick, onKeyDown, - className, style, separator, intl, } = this.props; + className, style, separator, intl, placeInTabOrder } = this.props; + + let index = (placeInTabOrder) ? 0 : -1; return ( - + count){ + active.tabIndex = -1; list.tabIndex = 0; this.counter = 0; list.focus(); diff --git a/bigbluebutton-html5/imports/ui/components/user-list/user-list-item/component.jsx b/bigbluebutton-html5/imports/ui/components/user-list/user-list-item/component.jsx index 81fb604e8f..59b9e130ae 100755 --- a/bigbluebutton-html5/imports/ui/components/user-list/user-list-item/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/user-list/user-list-item/component.jsx @@ -238,7 +238,7 @@ class UserListItem extends Component { let actions = this.getAvailableActions(); let contents = ( - + {this.renderUserName()} {this.renderUserIcons()} @@ -444,6 +444,7 @@ class UserListItem extends Component { defaultMessage={action.label} onClick={action.handler.bind(this, ...parameters)} ref={"test"} + placeInTabOrder={true} /> );