Skip to content

Commit

Permalink
Merge pull request #3197 from KhaledTo/bug/3031
Browse files Browse the repository at this point in the history
 Fixes #3031: Select2 creates multiple tags for tags with spaces
  • Loading branch information
jeremystretch authored May 29, 2019
2 parents c4f481d + cbace6f commit 00ffa35
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 00ffa35

Please sign in to comment.