From 3a1f595b82dd031fecdf8c43f921f9b0b5c96853 Mon Sep 17 00:00:00 2001 From: Zhe Sun <31067185+ZheSun88@users.noreply.github.com> Date: Mon, 29 Jul 2019 14:36:39 +0300 Subject: Ensure the upload button has been disabled when set Enabled calling from succeedL… (#11655) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Ensure the upload button has been disabled when calling from succeedListener with Push enabled * Add Tests to verify --- client/src/main/java/com/vaadin/client/ui/VUpload.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'client') diff --git a/client/src/main/java/com/vaadin/client/ui/VUpload.java b/client/src/main/java/com/vaadin/client/ui/VUpload.java index 681eaaf2f2..7ec8fbb71f 100644 --- a/client/src/main/java/com/vaadin/client/ui/VUpload.java +++ b/client/src/main/java/com/vaadin/client/ui/VUpload.java @@ -226,6 +226,17 @@ public class VUpload extends SimplePanel { rebuildPanel(); submitted = false; } + ensureUploadButton(); + + } + + private void ensureUploadButton() { + //when push got enabled, need to ensure the upload is disabled properly + //check ticket #11652 + if (fu.getElement().getParentElement().getParentElement() + .hasClassName("v-disabled")) { + disableUpload(); + } } private void setEnabledForSubmitButton(boolean enabled) { -- cgit v1.2.3