Commit dabb0e68 authored by Ryan Herbert's avatar Ryan Herbert

autocomplete.js fix autocomplete on undefined data

the beforeSave callback was causing an issue with the defaultLoadingData
being displayed when beforeSave waas called by At.js on the
defaultLoadingData.
This is a quick and dirty fix to ensure he callback doesn't attempt to
map the defaultLoadingData.

See #2706
parent b69a8dac
Pipeline #8263 passed with stages
in 4 minutes and 34 seconds
......@@ -121,6 +121,9 @@ VidjilAutoComplete.prototype = {
return $.fn.atwho.default.callbacks.filter(query, data, searchKey);
},
beforeSave: function(tags) {
if (tags.length == 1 && tags[0] == VidjilAutoComplete.defaultLoadingData[0]) {
return tags;
}
return $.map(tags, function(i) {
if (i.name === null) {
return i;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment