fix: spotlight bugs

This commit is contained in:
2023-10-16 13:58:00 +01:00
parent 5162887807
commit 65552e126b
2 changed files with 25 additions and 5 deletions

View File

@ -15,7 +15,7 @@
max-width: 100vw; max-width: 100vw;
max-height: 99vh; max-height: 99vh;
aspect-ratio: unset; aspect-ratio: unset;
width: unset; width: unset !important;
} }
.spotlight .details { .spotlight .details {

View File

@ -21,13 +21,17 @@ export function SpotlightMedia(props: SpotlightMediaProps) {
const handleKeyDown = (e: KeyboardEvent) => { const handleKeyDown = (e: KeyboardEvent) => {
switch (e.key) { switch (e.key) {
case "ArrowLeft": case "ArrowLeft":
case "ArrowUp": case "ArrowUp": {
e.preventDefault();
dec(); dec();
break; break;
}
case "ArrowRight": case "ArrowRight":
case "ArrowDown": case "ArrowDown": {
e.preventDefault();
inc(); inc();
break; break;
}
} }
}; };
@ -64,8 +68,24 @@ export function SpotlightMedia(props: SpotlightMediaProps) {
</div> </div>
{props.images.length > 1 && ( {props.images.length > 1 && (
<> <>
<Icon className="left" name="arrowFront" size={24} onClick={() => dec()} /> <Icon
<Icon className="right" name="arrowFront" size={24} onClick={() => inc()} /> className="left"
name="arrowFront"
size={24}
onClick={e => {
e.stopPropagation();
dec();
}}
/>
<Icon
className="right"
name="arrowFront"
size={24}
onClick={e => {
e.stopPropagation();
inc();
}}
/>
</> </>
)} )}
</div> </div>