mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-04-23 19:37:52 +00:00
focus password field when login page loads
This commit is contained in:
parent
6ca1c6a578
commit
6ec6e8f2d3
@ -395,6 +395,12 @@ function App() {
|
|||||||
const seedPhrase = generatorRef.current.parsedString
|
const seedPhrase = generatorRef.current.parsedString
|
||||||
saveSeedPhraseToDisk(seedPhrase)
|
saveSeedPhraseToDisk(seedPhrase)
|
||||||
}
|
}
|
||||||
|
const passwordRef = useRef<HTMLInputElement>(null);
|
||||||
|
useEffect(() => {
|
||||||
|
if (extState === "wallet-dropped" && passwordRef.current) {
|
||||||
|
passwordRef.current.focus();
|
||||||
|
}
|
||||||
|
}, [extState]);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const isDevModeFromStorage = localStorage.getItem("isEnabledDevMode");
|
const isDevModeFromStorage = localStorage.getItem("isEnabledDevMode");
|
||||||
if (isDevModeFromStorage) {
|
if (isDevModeFromStorage) {
|
||||||
@ -2318,6 +2324,7 @@ function App() {
|
|||||||
authenticateWallet();
|
authenticateWallet();
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
ref={passwordRef}
|
||||||
/>
|
/>
|
||||||
<Spacer height="20px" />
|
<Spacer height="20px" />
|
||||||
<CustomButton onClick={authenticateWallet}>
|
<CustomButton onClick={authenticateWallet}>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Button, InputAdornment, TextField, TextFieldProps, styled } from "@mui/material";
|
import { Button, InputAdornment, TextField, TextFieldProps, styled } from "@mui/material";
|
||||||
import { useState } from 'react'
|
import React, { forwardRef, useState } from 'react'
|
||||||
|
|
||||||
export const CustomInput = styled(TextField)({
|
export const CustomInput = styled(TextField)({
|
||||||
width: "183px", // Adjust the width as needed
|
width: "183px", // Adjust the width as needed
|
||||||
@ -41,7 +41,7 @@ export const CustomInput = styled(TextField)({
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
export const PasswordField: React.FunctionComponent<TextFieldProps> = ({ ...props }) => {
|
export const PasswordField = forwardRef<HTMLInputElement, TextFieldProps>( ({ ...props }, ref) => {
|
||||||
const [canViewPassword, setCanViewPassword] = useState(false);
|
const [canViewPassword, setCanViewPassword] = useState(false);
|
||||||
return (
|
return (
|
||||||
<CustomInput
|
<CustomInput
|
||||||
@ -55,7 +55,8 @@ export const PasswordField: React.FunctionComponent<TextFieldProps> = ({ ...prop
|
|||||||
</InputAdornment>
|
</InputAdornment>
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
|
inputRef={ref}
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
});
|
Loading…
x
Reference in New Issue
Block a user