Skip to content

Commit 95614b6

Browse files
authored
fix: constructor name support for IE11
1 parent e136096 commit 95614b6

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/components/MdAutocomplete/MdAutocomplete.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@
192192
this.showOptions()
193193
}
194194
195-
if (this.searchTerm.constructor.name.toLowerCase() !== 'inputevent') {
195+
if (this.searchTerm.constructor.toString().match(/function (\w*)/)[1].toLowerCase() !== 'inputevent') {
196196
this.$emit('md-changed', this.searchTerm)
197197
}
198198
},

src/components/MdField/MdFieldMixin.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default {
2121
return this.localValue
2222
},
2323
set (value) {
24-
if (value.constructor.name.toLowerCase() !== 'inputevent') {
24+
if (value.constructor.toString().match(/function (\w*)/)[1].toLowerCase() !== 'inputevent') {
2525
this.$nextTick(() => {
2626
this.localValue = value
2727
})

src/components/MdRipple/MdRipple.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
watch: {
5353
mdActive (active) {
5454
const isBoolean = typeof active === 'boolean'
55-
const isEvent = active.constructor.name.toLowerCase() === 'mouseevent'
55+
const isEvent = active.constructor.toString().match(/function (\w*)/)[1].toLowerCase() === 'mouseevent'
5656
5757
if (isBoolean && this.mdCentered && active) {
5858
this.startRipple({

0 commit comments

Comments
 (0)