mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-11-17 14:11:23 +01:00
Slight refactor to copy-as-curl
This commit is contained in:
1 parent
6639b07568
commit
71b06c5261
3 files changed
+20
-10
No files matched your search
@@ -40,6 +40,7 @@ export type DropdownItemDefault = {
|
||||
key: string;
|
||||
type?: 'default';
|
||||
label: ReactNode;
|
||||
keepOpen?: boolean;
|
||||
hotKeyAction?: HotkeyAction;
|
||||
hotKeyLabelOnly?: boolean;
|
||||
variant?: 'default' | 'danger' | 'notify';
|
||||
@@ -307,7 +308,9 @@ const Menu = forwardRef<Omit<DropdownRef, 'open' | 'isOpen' | 'toggle'>, MenuPro
|
||||
|
||||
const handleSelect = useCallback(
|
||||
(i: DropdownItem) => {
|
||||
handleClose();
|
||||
if (i.type !== 'separator' && !i.keepOpen) {
|
||||
handleClose();
|
||||
}
|
||||
setSelectedIndex(null);
|
||||
if (i.type !== 'separator') {
|
||||
i.onSelect?.();
|
||||
|
||||
Reference in new issue
Block a user