If the suggest url contains query parameters ("…/suggest?foo=bar") this will break the search. The parsed fetchURL will have the query params populated into the properties query as well as search. The update to include the search term manipulates query, but the search property remains unchanged. As documented "query … will only be used if search is absent."
|
const fetchURL = url.parse(optionUrl, true); |
|
fetchURL.query.term = input; |
|
|
|
return fetch(url.format(fetchURL), { credentials: 'same-origin' }) |
It seems to be sufficient to delete/unset search (directly updating search is more difficult as it is not parsed into an object):
fetchURL.search = undefined;
If the suggest url contains query parameters ("…/suggest?foo=bar") this will break the search. The parsed
fetchURLwill have the query params populated into the propertiesqueryas well assearch. The update to include the search term manipulatesquery, but thesearchproperty remains unchanged. As documented "query … will only be used if search is absent."silverstripe-tagfield/client/src/components/TagField.js
Lines 89 to 92 in f32c37c
It seems to be sufficient to delete/unset search (directly updating search is more difficult as it is not parsed into an object):