Merge pull request #522 from mickaobrien/timeline-enter-keyboard-shortcut-fix

Fix `enter` keyboard shortcut on timeline
This commit is contained in:
Chee Aun 2024-04-28 08:29:47 +08:00 committed by GitHub
commit 044f754d7e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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