Emoji Picker: Focused emoji does not move with the arrow keys (#30893)

* We should focus the node in the DOM so that the browser focus(with outline) matches the our internal RovingIndex state

* Don't move focus from the input if we are in "virtual" focus(via active descendant)
This commit is contained in:
David Langley
2025-10-29 16:16:03 +00:00
committed by GitHub
parent 2ab42df0c8
commit d558fa79e0
2 changed files with 78 additions and 0 deletions

View File

@@ -187,6 +187,11 @@ class EmojiPicker extends React.Component<IProps, IState> {
}
if (focusNode) {
// Only move actual DOM focus if an emoji already has focus
// If the input has focus, keep using aria-activedescendant for virtual focus
if (document.activeElement !== document.querySelector(".mx_EmojiPicker_search input")) {
focusNode?.focus();
}
dispatch({
type: Type.SetFocus,
payload: { node: focusNode },