Skip to content

A local-first personal finance app

Fix submit form on enter key pressed (#1634)

Syukron Rifa'il Muttaqi108daedff5fe
diff --git a/packages/desktop-client/src/components/common/Button.tsx b/packages/desktop-client/src/components/common/Button.tsx
index 6b5355d7ef..a619b4d194 100644
--- a/packages/desktop-client/src/components/common/Button.tsx
+++ b/packages/desktop-client/src/components/common/Button.tsx
@@ -143,8 +143,9 @@ const Button = forwardRef<HTMLButtonElement, ButtonProps>(
{...(typeof as === 'string'
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
(css(buttonStyle) as any)
- : { style: buttonStyle, type: isSubmit ? 'submit' : 'button' })}
+ : { style: buttonStyle })}
disabled={disabled}
+ type={isSubmit ? 'submit' : 'button'}
{...nativeProps}
>
{children}
diff --git a/packages/desktop-client/src/components/modals/FixEncryptionKey.js b/packages/desktop-client/src/components/modals/FixEncryptionKey.js
index 099bd34981..e8edc6237c 100644
--- a/packages/desktop-client/src/components/modals/FixEncryptionKey.js
+++ b/packages/desktop-client/src/components/modals/FixEncryptionKey.js
@@ -127,7 +127,7 @@ export default function FixEncryptionKey({
<Button
style={{ marginRight: 10 }}
onClick={() => modalProps.onBack()}
- type="button"
+ type="normal"
>
Back
</Button>
diff --git a/upcoming-release-notes/1634.md b/upcoming-release-notes/1634.md
new file mode 100644
index 0000000000..0df21feaed
--- /dev/null
+++ b/upcoming-release-notes/1634.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [syukronrm]
+---
+
+Fix pressing Enter on Encryption Key cancels entry instead of update the key