Cmd+n to open dropdown

This commit is contained in:
Gregory Schier
2024-02-11 14:17:09 -08:00
parent a74ea1aeda
commit 720745857d
4 changed files with 9 additions and 6 deletions

View File

@@ -31,7 +31,7 @@ export function RecentRequestsDropdown({ className }: Pick<ButtonProps, 'classNa
useKey('k', (e) => {
if (e.metaKey) {
e.preventDefault();
dropdownRef.current?.toggle(0);
dropdownRef.current?.toggle();
}
});
@@ -42,12 +42,12 @@ export function RecentRequestsDropdown({ className }: Pick<ButtonProps, 'classNa
});
useHotKey('requestSwitcher.prev', () => {
if (!dropdownRef.current?.isOpen) dropdownRef.current?.open(1);
if (!dropdownRef.current?.isOpen) dropdownRef.current?.open();
dropdownRef.current?.next?.();
});
useHotKey('requestSwitcher.next', () => {
if (!dropdownRef.current?.isOpen) dropdownRef.current?.open(-1);
if (!dropdownRef.current?.isOpen) dropdownRef.current?.open();
dropdownRef.current?.prev?.();
});