restore messages tab stop and arrow key navigation

This commit is contained in:
KDSBrowne 2023-07-18 22:55:35 +00:00
parent 5a85ca14a2
commit 19ea189302
2 changed files with 4 additions and 3 deletions

View File

@ -51,7 +51,7 @@ const propTypes = {
const defaultProps = {
shortcuts: '',
tabIndex: 0,
tabIndex: -1,
};
const ChatListItem = (props) => {

View File

@ -47,13 +47,13 @@ class UserMessages extends PureComponent {
this._msgsList.addEventListener(
'keydown',
this.rove,
true,
);
}
}
componentDidUpdate(prevProps, prevState) {
const { selectedChat } = this.state;
if (selectedChat && selectedChat !== prevState.selectedChat) {
const { firstChild } = selectedChat;
if (firstChild) firstChild.focus();
@ -97,6 +97,7 @@ class UserMessages extends PureComponent {
const { selectedChat } = this.state;
const msgItemsRef = findDOMNode(this._msgItems);
roving(event, this.changeState, msgItemsRef, selectedChat);
event.stopPropagation();
}
render() {
@ -120,7 +121,7 @@ class UserMessages extends PureComponent {
</Styled.Container>
<Styled.ScrollableList
role="tabpanel"
tabIndex={-1}
tabIndex={0}
ref={(ref) => { this._msgsList = ref; }}
>
<Styled.List>