mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-23 01:35:38 +03:00
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.
This commit is contained in:
parent
7376cb1e99
commit
5ae2058c07
1 changed files with 2 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue