From 95614b6e0ba376e09e456037d72749313cb6abcd Mon Sep 17 00:00:00 2001 From: Samuell Date: Sat, 7 Apr 2018 12:32:17 +0200 Subject: [PATCH] fix: constructor name support for IE11 --- src/components/MdAutocomplete/MdAutocomplete.vue | 2 +- src/components/MdField/MdFieldMixin.js | 2 +- src/components/MdRipple/MdRipple.vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/MdAutocomplete/MdAutocomplete.vue b/src/components/MdAutocomplete/MdAutocomplete.vue index 9111e2c4d..69d7620f4 100644 --- a/src/components/MdAutocomplete/MdAutocomplete.vue +++ b/src/components/MdAutocomplete/MdAutocomplete.vue @@ -192,7 +192,7 @@ this.showOptions() } - if (this.searchTerm.constructor.name.toLowerCase() !== 'inputevent') { + if (this.searchTerm.constructor.toString().match(/function (\w*)/)[1].toLowerCase() !== 'inputevent') { this.$emit('md-changed', this.searchTerm) } }, diff --git a/src/components/MdField/MdFieldMixin.js b/src/components/MdField/MdFieldMixin.js index 08d3b0f5d..78815df94 100644 --- a/src/components/MdField/MdFieldMixin.js +++ b/src/components/MdField/MdFieldMixin.js @@ -21,7 +21,7 @@ export default { return this.localValue }, set (value) { - if (value.constructor.name.toLowerCase() !== 'inputevent') { + if (value.constructor.toString().match(/function (\w*)/)[1].toLowerCase() !== 'inputevent') { this.$nextTick(() => { this.localValue = value }) diff --git a/src/components/MdRipple/MdRipple.vue b/src/components/MdRipple/MdRipple.vue index 8520a49a1..01ae6129f 100644 --- a/src/components/MdRipple/MdRipple.vue +++ b/src/components/MdRipple/MdRipple.vue @@ -52,7 +52,7 @@ watch: { mdActive (active) { const isBoolean = typeof active === 'boolean' - const isEvent = active.constructor.name.toLowerCase() === 'mouseevent' + const isEvent = active.constructor.toString().match(/function (\w*)/)[1].toLowerCase() === 'mouseevent' if (isBoolean && this.mdCentered && active) { this.startRipple({