mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 19:56:47 +03:00
Tweak roving tab index focus behaviour (#7254)
This commit is contained in:
parent
0afe141266
commit
68604e3505
1 changed files with 4 additions and 1 deletions
|
@ -130,7 +130,10 @@ export const reducer = (state: IState, action: IAction) => {
|
|||
state.activeRef = findSiblingElement(state.refs, oldIndex)
|
||||
|| findSiblingElement(state.refs, oldIndex, true);
|
||||
}
|
||||
state.activeRef?.current?.focus();
|
||||
if (document.activeElement === document.body) {
|
||||
// if the focus got reverted to the body then the user was likely focused on the unmounted element
|
||||
state.activeRef?.current?.focus();
|
||||
}
|
||||
}
|
||||
|
||||
// update the refs list
|
||||
|
|
Loading…
Reference in a new issue