Fix `enter` keyboard shortcut on timeline

Currently pressing `enter` opens the active status if the status or any
focusable child of the status is focused e.g. the avatar or a link.

I think it should only open the post details when the post itself is
focused.
pull/522/head
Mick O'Brien 2024-04-26 12:23:53 +01:00
rodzic 7376cb1e99
commit 5ae2058c07
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -209,8 +209,8 @@ function Timeline({
const oRef = useHotkeys(['enter', 'o'], () => {
// open active status
const activeItem = document.activeElement.closest(itemsSelector);
if (activeItem) {
const activeItem = document.activeElement;
if (activeItem?.matches(itemsSelector)) {
activeItem.click();
}
});