From 3affe2b303225dedcca727024a4c8fdcef6e07dd Mon Sep 17 00:00:00 2001 From: Daniel Hritzkiv Date: Wed, 22 Nov 2017 17:10:31 -0500 Subject: [PATCH] Don't change `type` property on textarea --- ampersand-input-view.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/ampersand-input-view.js b/ampersand-input-view.js index 72d8047..9167b28 100644 --- a/ampersand-input-view.js +++ b/ampersand-input-view.js @@ -178,14 +178,16 @@ module.exports = View.extend({ } }, handleTypeChange: function () { - if (this.type === 'textarea' && this.input.tagName.toLowerCase() !== 'textarea') { - var parent = this.input.parentNode; - var textarea = document.createElement('textarea'); - parent.replaceChild(textarea, this.input); - this.input = textarea; - this._applyBindingsForKey(''); - } else { - this.input.type = this.type; + if (this.input.tagName.toLowerCase() !== 'textarea') { + if (this.type === 'textarea') { + var parent = this.input.parentNode; + var textarea = document.createElement('textarea'); + parent.replaceChild(textarea, this.input); + this.input = textarea; + this._applyBindingsForKey(''); + } else { + this.input.type = this.type; + } } }, clean: function (val) {