Skip to content

Commit

Permalink
Fixes netbox-community#3031: Select2 creates multiple tags for tags w…
Browse files Browse the repository at this point in the history
…ith spaces
  • Loading branch information
Khaled BEN ABDALLAH committed May 18, 2019
1 parent edabc8e commit cbace6f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions netbox/project-static/js/forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,10 @@ $(document).ready(function() {

processResults: function (data) {
var results = $.map(data.results, function (obj) {
// If tag contains space add double quotes
if (/\s/.test(obj.name))
obj.name = '"' + obj.name + '"'

return {
id: obj.name,
text: obj.name
Expand Down

0 comments on commit cbace6f

Please sign in to comment.