fix: spotlight bugs

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

View File

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

View File

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