UI: Auto focus hashnet upgrade modal (#1768)

This commit is contained in:
catloversg 2024-11-11 13:54:51 +07:00 committed by GitHub
parent 40651a757d
commit cb9e281c45
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

@ -110,7 +110,15 @@ export function HacknetRoot(): React.ReactElement {
{hasHacknetServers() && (
<>
<Button onClick={() => setOpen(true)}>Spend Hashes on Upgrades</Button>
{/*
The usage of focusRipple in this button is intentional. Without it, after closing the modal by pressing the
Esc button, this button has a weird ripple effect (only on Chrome).
The documentation says that focusRipple is false by default, but I have to explicitly set it to false to fix
this weird ripple effect.
*/}
<Button focusRipple={false} onClick={() => setOpen(true)}>
Spend Hashes on Upgrades
</Button>
<br />
</>
)}

@ -24,7 +24,7 @@ export function HashUpgradeModal(props: IProps): React.ReactElement {
}
return (
<Modal open={props.open} onClose={props.onClose}>
<Modal open={props.open} onClose={props.onClose} removeFocus={false}>
<>
<Typography>Spend your hashes on a variety of different upgrades</Typography>
<Typography>