Skip to content

Commit

Permalink
Fix issue with "disabled" attribute not being correctly handled for s…
Browse files Browse the repository at this point in the history
…elect items
  • Loading branch information
root committed Jan 5, 2019
1 parent 64de43f commit 4071b7c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/jsonform.js
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ jsonform.elementTypes = {
'select':{
'template':'<select name="<%= node.name %>" id="<%= id %>"' +
'class=\'form-control<%= (fieldHtmlClass ? " " + fieldHtmlClass : "") %>\'' +
'<%= (node.disabled? " disabled" : "")%>' +
'<%= (node.schemaElement && node.schemaElement.disabled? " disabled" : "")%>' +
'<%= (node.schemaElement && node.schemaElement.required ? " required=\'required\'" : "") %>' +
'> ' +
'<% _.each(node.options, function(key, val) { if(key instanceof Object) { if (value === key.value) { %> <option selected value="<%= key.value %>"><%= key.title %></option> <% } else { %> <option value="<%= key.value %>"><%= key.title %></option> <% }} else { if (value === key) { %> <option selected value="<%= key %>"><%= key %></option> <% } else { %><option value="<%= key %>"><%= key %></option> <% }}}); %> ' +
Expand Down

0 comments on commit 4071b7c

Please sign in to comment.