gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated: fix #8987


From: gnunet
Subject: [taler-wallet-core] branch master updated: fix #8987
Date: Mon, 16 Sep 2024 17:25:15 +0200

This is an automated email from the git hooks/post-receive script.

sebasjm pushed a commit to branch master
in repository wallet-core.

The following commit(s) were added to refs/heads/master by this push:
     new a08d5dd17 fix #8987
a08d5dd17 is described below

commit a08d5dd17c26fab089ba42823afc148113e32658
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Mon Sep 16 12:25:08 2024 -0300

    fix #8987
---
 .../merchant-backoffice-ui/src/components/form/InputImage.tsx  |  9 ++++++++-
 .../src/components/product/ProductForm.tsx                     | 10 ++++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/packages/merchant-backoffice-ui/src/components/form/InputImage.tsx 
b/packages/merchant-backoffice-ui/src/components/form/InputImage.tsx
index 22526f947..b1998a457 100644
--- a/packages/merchant-backoffice-ui/src/components/form/InputImage.tsx
+++ b/packages/merchant-backoffice-ui/src/components/form/InputImage.tsx
@@ -77,7 +77,9 @@ export function InputImage<T>({
               readonly={readonly}
               onChange={(e) => {
                 const f: FileList | null = e.currentTarget.files;
+                console.log("on change", e, f)
                 if (!f || f.length != 1) {
+
                   return onChange(undefined!);
                 }
                 if (f[0].size > MAX_IMAGE_UPLOAD_SIZE) {
@@ -111,7 +113,12 @@ export function InputImage<T>({
             </button>
           )}
           {value && (
-            <button class="button" onClick={() => onChange(undefined!)}>
+            <button class="button" onClick={() => {
+              if (image.current) {
+                image.current.value = ""
+              }
+              onChange(undefined!);
+            }}>
               <i18n.Translate>Remove</i18n.Translate>
             </button>
           )}
diff --git 
a/packages/merchant-backoffice-ui/src/components/product/ProductForm.tsx 
b/packages/merchant-backoffice-ui/src/components/product/ProductForm.tsx
index 1e520a39e..03afd3222 100644
--- a/packages/merchant-backoffice-ui/src/components/product/ProductForm.tsx
+++ b/packages/merchant-backoffice-ui/src/components/product/ProductForm.tsx
@@ -173,6 +173,16 @@ export function ProductForm({ onSubscribe, initial, 
alreadyExist }: Props) {
         object={value}
         valueHandler={valueHandler}
       >
+        {/**
+         * If the user press enter on any text field it will the browser will 
trigger
+         * the first button that it found.
+         * 
+         * In this form the InputImage will be triggered and this is unwanted.
+         * 
+         * As a workaround we have this non-action button which will prevent 
loading/unloading
+         * the image when the enter key is pressed accidentally.
+         */}
+        <button />
         {alreadyExist ? undefined : (
           <InputWithAddon<Entity>
             name="product_id"

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]