Fix #1394: A bug in IE 10/11 causes the placeholder text to be copied to "value"

This commit is contained in:
Praseeth T
2015-06-21 11:37:29 +05:30
parent d75505fb73
commit 6d4bc72a64

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);
} }
} }