From 2ec04fbb915a2d3428312288a282008c138a9a62 Mon Sep 17 00:00:00 2001
From: Yoshie Muranaka <yoshiemuranaka@gmail.com>
Date: Wed, 20 Jan 2021 12:19:16 -0800
Subject: Add disabled class to FormFile component

Passing disabled prop to button and span so file upload button can
visually reflect a disabled form control state.

Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com>
Change-Id: I78f2db521c4f4016e7e2aa92e5a56bc4f9170fe0
---
 src/components/Global/FormFile.vue | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

(limited to 'src/components/Global/FormFile.vue')

diff --git a/src/components/Global/FormFile.vue b/src/components/Global/FormFile.vue
index 30af00d7..eaed445d 100644
--- a/src/components/Global/FormFile.vue
+++ b/src/components/Global/FormFile.vue
@@ -11,14 +11,18 @@
         @input="$emit('input', file)"
       >
       </b-form-file>
-      <span class="add-file-btn btn btn-primary">
+      <span class="add-file-btn btn btn-primary" :class="{ disabled }">
         {{ $t('global.fileUpload.browseText') }}
       </span>
       <slot name="invalid"></slot>
     </label>
     <div v-if="file" class="clear-selected-file px-3 py-2 mt-2">
       {{ file ? file.name : '' }}
-      <b-button variant="light" class="px-2 ml-auto" @click="file = null"
+      <b-button
+        variant="light"
+        class="px-2 ml-auto"
+        :disabled="disabled"
+        @click="file = null"
         ><icon-close :title="$t('global.fileUpload.clearSelectedFile')"
       /></b-button>
     </div>
-- 
cgit v1.2.3

