Restore older behaviour

accidentally left off in 9a5bac774e
This commit is contained in:
Manav Rathi
2025-06-06 17:50:26 +05:30
parent 930070ad14
commit 9cacbb4f34
10 changed files with 8 additions and 7 deletions

View File

@@ -374,7 +374,6 @@ const ManagePasskeyDrawer: React.FC<ManagePasskeyDrawerProps> = ({
title={t("rename_passkey")}
label={t("name")}
placeholder={t("enter_passkey_name")}
autoFocus
initialValue={passkey.friendlyName}
submitButtonTitle={t("rename")}
onSubmit={handleRenamePasskeySubmit}

View File

@@ -520,7 +520,6 @@ const CollectionOptions: React.FC<CollectionHeaderProps> = ({
{...albumNameInputVisibilityProps}
title={t("rename_album")}
label={t("album_name")}
autoFocus
initialValue={activeCollection?.name}
submitButtonColor="primary"
submitButtonTitle={t("rename")}

View File

@@ -852,7 +852,6 @@ export const Upload: React.FC<UploadProps> = ({
{...newAlbumNameInputVisibilityProps}
title={t("new_album")}
label={t("album_name")}
autoFocus
initialValue={prefilledNewAlbumName}
submitButtonTitle={t("create")}
onSubmit={uploadToSingleNewCollection}

View File

@@ -1143,7 +1143,6 @@ const Page: React.FC = () => {
{...albumNameInputVisibilityProps}
title={t("new_album")}
label={t("album_name")}
autoFocus
submitButtonTitle={t("create")}
onSubmit={handleAlbumNameSubmit}
/>

View File

@@ -98,6 +98,7 @@ export const LoginContents: React.FC<LoginContentsProps> = ({
autoComplete="username"
label={t("enter_email")}
fullWidth
autoFocus
margin="normal"
disabled={formik.isSubmitting}
error={!!formik.errors.email}

View File

@@ -204,6 +204,7 @@ export const VerifyMasterPasswordForm: React.FC<
autoComplete="current-password"
label={t("password")}
fullWidth
autoFocus
margin="normal"
disabled={formik.isSubmitting}
error={!!formik.errors.password}

View File

@@ -91,10 +91,14 @@ export type SingleInputFormProps = Pick<
* Submission is handled as an async function, during which the input is
* disabled and a loading indicator is shown. Errors during submission are shown
* as the helper text associated with the text field.
*
* The input field in the form takes autoFocus automatically on mount. Turn off
* the {@link autoFocus} to disable this behaviour if needed.
*/
export const SingleInputForm: React.FC<SingleInputFormProps> = ({
inputType,
initialValue,
autoFocus,
submitButtonTitle,
submitButtonColor,
onCancel,
@@ -153,6 +157,7 @@ export const SingleInputForm: React.FC<SingleInputFormProps> = ({
onChange={formik.handleChange}
type={showPassword ? "text" : (inputType ?? "text")}
fullWidth
autoFocus={autoFocus ?? true}
margin="normal"
disabled={formik.isSubmitting}
error={!!formik.errors.value}

View File

@@ -842,7 +842,6 @@ const RenameFileDialog: React.FC<RenameFileDialogProps> = ({
<SingleInputForm
label={t("file_name")}
placeholder={t("file_name")}
autoFocus
initialValue={name}
submitButtonColor="primary"
submitButtonTitle={t("rename")}

View File

@@ -96,6 +96,7 @@ export const UploaderNameInput: React.FC<UploaderNameInput> = ({
onChange={formik.handleChange}
type={"text"}
fullWidth
autoFocus
margin="normal"
hiddenLabel
aria-label={t("name")}

View File

@@ -166,7 +166,6 @@ const CGroupPersonHeader: React.FC<CGroupPersonHeaderProps> = ({ person }) => {
label={t("name")}
placeholder={t("enter_name")}
autoComplete="name"
autoFocus
initialValue={name}
submitButtonColor="primary"
submitButtonTitle={t("rename")}
@@ -373,7 +372,6 @@ const AddPersonDialog: React.FC<AddPersonDialogProps> = ({
label={t("add_name")}
placeholder={t("enter_name")}
autoComplete="name"
autoFocus
submitButtonColor="primary"
submitButtonTitle={t("add")}
onSubmit={handleAddPersonWithName}