Skip to content

Commit 21d7e67

Browse files
VdustRSamuell1
authored andcommitted
fix(MdFile): disabled icon (#1787)
fix #1782
1 parent c3f6eb0 commit 21d7e67

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

src/components/MdField/MdFile/MdFile.vue

+16-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="md-file">
3-
<md-file-icon @click.native="openPicker" />
3+
<md-file-icon class="md-file-icon" :class="iconClass" @click.native="openPicker" />
44

55
<input
66
class="md-input"
@@ -31,6 +31,13 @@
3131
},
3232
name: String
3333
},
34+
computed: {
35+
iconClass () {
36+
return {
37+
'md-disabled': this.disabled
38+
}
39+
}
40+
},
3441
mixins: [MdFieldMixin],
3542
inject: ['MdField'],
3643
methods: {
@@ -95,8 +102,14 @@
95102
border: 0;
96103
}
97104
98-
.md-icon {
99-
cursor: pointer;
105+
.md-file-icon {
106+
&:not(.md-disabled) {
107+
cursor: pointer;
108+
}
109+
110+
&.md-disabled {
111+
pointer-events: none;
112+
}
100113
}
101114
}
102115
</style>

0 commit comments

Comments
 (0)