restore messages tab stop and arrow key navigation
This commit is contained in:
parent
5a85ca14a2
commit
19ea189302
@ -51,7 +51,7 @@ const propTypes = {
|
|||||||
|
|
||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
shortcuts: '',
|
shortcuts: '',
|
||||||
tabIndex: 0,
|
tabIndex: -1,
|
||||||
};
|
};
|
||||||
|
|
||||||
const ChatListItem = (props) => {
|
const ChatListItem = (props) => {
|
||||||
|
@ -47,13 +47,13 @@ class UserMessages extends PureComponent {
|
|||||||
this._msgsList.addEventListener(
|
this._msgsList.addEventListener(
|
||||||
'keydown',
|
'keydown',
|
||||||
this.rove,
|
this.rove,
|
||||||
|
true,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate(prevProps, prevState) {
|
componentDidUpdate(prevProps, prevState) {
|
||||||
const { selectedChat } = this.state;
|
const { selectedChat } = this.state;
|
||||||
|
|
||||||
if (selectedChat && selectedChat !== prevState.selectedChat) {
|
if (selectedChat && selectedChat !== prevState.selectedChat) {
|
||||||
const { firstChild } = selectedChat;
|
const { firstChild } = selectedChat;
|
||||||
if (firstChild) firstChild.focus();
|
if (firstChild) firstChild.focus();
|
||||||
@ -97,6 +97,7 @@ class UserMessages extends PureComponent {
|
|||||||
const { selectedChat } = this.state;
|
const { selectedChat } = this.state;
|
||||||
const msgItemsRef = findDOMNode(this._msgItems);
|
const msgItemsRef = findDOMNode(this._msgItems);
|
||||||
roving(event, this.changeState, msgItemsRef, selectedChat);
|
roving(event, this.changeState, msgItemsRef, selectedChat);
|
||||||
|
event.stopPropagation();
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
@ -120,7 +121,7 @@ class UserMessages extends PureComponent {
|
|||||||
</Styled.Container>
|
</Styled.Container>
|
||||||
<Styled.ScrollableList
|
<Styled.ScrollableList
|
||||||
role="tabpanel"
|
role="tabpanel"
|
||||||
tabIndex={-1}
|
tabIndex={0}
|
||||||
ref={(ref) => { this._msgsList = ref; }}
|
ref={(ref) => { this._msgsList = ref; }}
|
||||||
>
|
>
|
||||||
<Styled.List>
|
<Styled.List>
|
||||||
|
Loading…
Reference in New Issue
Block a user