Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Restore older behaviour

Manav Rathi9cacbb4f349b
diff --git a/web/apps/accounts/src/pages/passkeys/index.tsx b/web/apps/accounts/src/pages/passkeys/index.tsx
index 5aab316ffa..3a13bceb9a 100644
--- a/web/apps/accounts/src/pages/passkeys/index.tsx
+++ b/web/apps/accounts/src/pages/passkeys/index.tsx
@@ -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}
diff --git a/web/apps/photos/src/components/Collections/CollectionHeader.tsx b/web/apps/photos/src/components/Collections/CollectionHeader.tsx
index 4e8031e23b..11062597ee 100644
--- a/web/apps/photos/src/components/Collections/CollectionHeader.tsx
+++ b/web/apps/photos/src/components/Collections/CollectionHeader.tsx
@@ -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")}
diff --git a/web/apps/photos/src/components/Upload.tsx b/web/apps/photos/src/components/Upload.tsx
index 25ef5cfe81..0d87895552 100644
--- a/web/apps/photos/src/components/Upload.tsx
+++ b/web/apps/photos/src/components/Upload.tsx
@@ -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}
diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsx
index c77158232a..46b151ef22 100644
--- a/web/apps/photos/src/pages/gallery.tsx
+++ b/web/apps/photos/src/pages/gallery.tsx
@@ -1143,7 +1143,6 @@ const Page: React.FC = () => {
{...albumNameInputVisibilityProps}
title={t("new_album")}
label={t("album_name")}
- autoFocus
submitButtonTitle={t("create")}
onSubmit={handleAlbumNameSubmit}
/>
diff --git a/web/packages/accounts/components/LoginContents.tsx b/web/packages/accounts/components/LoginContents.tsx
index cc020fb263..8cfd131d47 100644
--- a/web/packages/accounts/components/LoginContents.tsx
+++ b/web/packages/accounts/components/LoginContents.tsx
@@ -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}
diff --git a/web/packages/accounts/components/VerifyMasterPasswordForm.tsx b/web/packages/accounts/components/VerifyMasterPasswordForm.tsx
index ddbfe612f3..274f5b420e 100644
--- a/web/packages/accounts/components/VerifyMasterPasswordForm.tsx
+++ b/web/packages/accounts/components/VerifyMasterPasswordForm.tsx
@@ -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}
diff --git a/web/packages/base/components/SingleInputForm.tsx b/web/packages/base/components/SingleInputForm.tsx
index c003d843e8..5229adc2fd 100644
--- a/web/packages/base/components/SingleInputForm.tsx
+++ b/web/packages/base/components/SingleInputForm.tsx
@@ -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}
diff --git a/web/packages/gallery/components/FileInfo.tsx b/web/packages/gallery/components/FileInfo.tsx
index 658175da5c..b6f1cc54f6 100644
--- a/web/packages/gallery/components/FileInfo.tsx
+++ b/web/packages/gallery/components/FileInfo.tsx
@@ -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")}
diff --git a/web/packages/new/albums/components/UploaderNameInput.tsx b/web/packages/new/albums/components/UploaderNameInput.tsx
index 97c8dac07a..cbb038d5b9 100644
--- a/web/packages/new/albums/components/UploaderNameInput.tsx
+++ b/web/packages/new/albums/components/UploaderNameInput.tsx
@@ -96,6 +96,7 @@ export const UploaderNameInput: React.FC<UploaderNameInput> = ({
onChange={formik.handleChange}
type={"text"}
fullWidth
+ autoFocus
margin="normal"
hiddenLabel
aria-label={t("name")}
diff --git a/web/packages/new/photos/components/gallery/PeopleHeader.tsx b/web/packages/new/photos/components/gallery/PeopleHeader.tsx
index b4a9a0cc18..f730d9bd19 100644
--- a/web/packages/new/photos/components/gallery/PeopleHeader.tsx
+++ b/web/packages/new/photos/components/gallery/PeopleHeader.tsx
@@ -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}