Select / SetValue / TriggerUpdate with only string parameters
ssabw1 opened this issue · comments
ssabw1 commented
formio.js/src/components/select/Select.js
Line 1522 in 832f6ca
We have a case that this function takes the next parameters:
this.triggerUpdate(_.get(undefined || 'Cardiff', 'search', 'Cardiff'), true);
In this case we get an empty function like function search() { [native code] }
and this causes to throw an error.
Maybe need to check this case like:
var defaultValue = value;
value = !value.data && typeof value === 'string' && typeof searchProperty === 'string' && !!searchProperty.length ? {[searchProperty]: value} : value;
this.triggerUpdate(_.get(value.data || value, searchProperty, defaultValue), true);
Or maybe have another solution?
Thanks a lot.