Merge pull request #1395 from praseetht/master

Fix #1394: A bug in IE 10/11 causes the placeholder text to be copied to value
This commit is contained in:
Tony Tam
2015-07-22 18:03:32 -07:00

View File

@@ -52,7 +52,9 @@ SwaggerUi.Views.SignatureView = Backbone.View.extend({
if (e) { e.preventDefault(); } if (e) { e.preventDefault(); }
var textArea = $('textarea', $(this.el.parentNode.parentNode.parentNode)); var textArea = $('textarea', $(this.el.parentNode.parentNode.parentNode));
if ($.trim(textArea.val()) === '') {
// Fix for bug in IE 10/11 which causes placeholder text to be copied to "value"
if ($.trim(textArea.val()) === '' || textArea.prop('placeholder') === textArea.val()) {
textArea.val(this.model.sampleJSON); textArea.val(this.model.sampleJSON);
} }
} }