mirror of
https://github.com/stashapp/stash.git
synced 2026-02-16 12:22:18 +01:00
Fix keyboard shortcuts not working after selecting (#2756)
* Fix keyboard shortcuts not working after selecting
This commit is contained in:
parent
e532f9a683
commit
db3138b33f
3 changed files with 13 additions and 12 deletions
|
|
@ -1,4 +1,5 @@
|
|||
### 🐛 Bug fixes
|
||||
* Fix keyboard shortcuts not working after selecting an object. ([#2750](https://github.com/stashapp/stash/pull/2750))
|
||||
* Fix UI crash on session timeout. ([#2755](https://github.com/stashapp/stash/pull/2755))
|
||||
* Fix incorrect scene metadata being set when video has cover art. ([#2752](https://github.com/stashapp/stash/pull/2752))
|
||||
* Fix incorrect image being displayed when first previewing image. ([#2754](https://github.com/stashapp/stash/pull/2754))
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
};
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -65,7 +65,8 @@ export const GridCard: React.FC<ICardProps> = (props: ICardProps) => {
|
|||
return (
|
||||
<Form.Control
|
||||
type="checkbox"
|
||||
className="card-check"
|
||||
// #2750 - add mousetrap class to ensure keyboard shortcuts work
|
||||
className="card-check mousetrap"
|
||||
checked={props.selected}
|
||||
onChange={() => props.onSelectedChanged!(!props.selected, shiftKey)}
|
||||
onClick={(event: React.MouseEvent<HTMLInputElement, MouseEvent>) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue