mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 12:54:38 +03:00
Fix keyboard shortcuts not working after selecting (#2756)
* Fix keyboard shortcuts not working after selecting
This commit is contained in:
@@ -47,24 +47,23 @@ export const ListOperationButtons: React.FC<IListOperationButtonsProps> = ({
|
||||
Mousetrap.bind("s a", () => onSelectAll?.());
|
||||
Mousetrap.bind("s n", () => onSelectNone?.());
|
||||
|
||||
if (itemsSelected) {
|
||||
Mousetrap.bind("e", () => {
|
||||
Mousetrap.bind("e", () => {
|
||||
if (itemsSelected) {
|
||||
onEdit?.();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Mousetrap.bind("d d", () => {
|
||||
Mousetrap.bind("d d", () => {
|
||||
if (itemsSelected) {
|
||||
onDelete?.();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return () => {
|
||||
Mousetrap.unbind("s a");
|
||||
Mousetrap.unbind("s n");
|
||||
|
||||
if (itemsSelected) {
|
||||
Mousetrap.unbind("e");
|
||||
Mousetrap.unbind("d d");
|
||||
}
|
||||
Mousetrap.unbind("e");
|
||||
Mousetrap.unbind("d d");
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user