You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are utilizing reactivesearch to query some Elastic data. We are utilizing the showMissing prop option on several filters that are using MultiList. Our understanding is that missing/null data is necessary for showMissing to function and this is all working.
There is also a DataSearch. Today, I was asked to connect the DataSearch to more dataFields and some of those fields are null for some records. For the showMissing to function, I can't (as far as I know) avoid having these null values. When I added the additional fields to the DataSearch's dataFields, the app would crash as soon as I typed anything into the input.
Stack trace showed it was crashing at the str.replace in replaceDiacritics (in suggestions.js) because str had a value of null:
functionreplaceDiacritics(s){letstr=s ? String(s) : s;constdiacritics=[/[\300-\306]/g,/[\340-\346]/g,// A, a/[\310-\313]/g,/[\350-\353]/g,// E, e/[\314-\317]/g,/[\354-\357]/g,// I, i/[\322-\330]/g,/[\362-\370]/g,// O, o/[\331-\334]/g,/[\371-\374]/g,// U, u/[\321]/g,/[\361]/g,// N, n/[\307]/g,/[\347]/g,// C, c];constchars=['A','a','E','e','I','i','O','o','U','u','N','n','C','c'];for(leti=0;i<diacritics.length;i+=1){str=str.replace(diacritics[i],chars[i]);// crash here}returnstr;}
I won't say this is the best fix, but I put a band-aid on the issue by changing
constpopulateSuggestionsList=(val,parsedSource,source)=>{// check if the suggestion includes the current value// and not already included in other suggestionsconstisWordMatch=skipWordMatch||currentValue.....
into
constpopulateSuggestionsList=(val,parsedSource,source)=>{// check if the suggestion includes the current value// and not already included in other suggestionsval=val ? val : '';// newconstisWordMatch=skipWordMatch||currentValue.....
There may be reasons I'm not aware of that you wouldn't want to support the possibility of autosuggest encountering null values, but I thought I would open the issue to inquire if this was the intended behavior.
The text was updated successfully, but these errors were encountered:
We are utilizing
reactivesearch
to query some Elastic data. We are utilizing theshowMissing
prop option on several filters that are usingMultiList
. Our understanding is that missing/null data is necessary forshowMissing
to function and this is all working.There is also a
DataSearch
. Today, I was asked to connect theDataSearch
to moredataFields
and some of those fields are null for some records. For theshowMissing
to function, I can't (as far as I know) avoid having thesenull
values. When I added the additional fields to theDataSearch
'sdataFields
, the app would crash as soon as I typed anything into the input.Stack trace showed it was crashing at the
str.replace
inreplaceDiacritics
(in suggestions.js) becausestr
had a value ofnull
:I won't say this is the best fix, but I put a band-aid on the issue by changing
into
There may be reasons I'm not aware of that you wouldn't want to support the possibility of autosuggest encountering
null
values, but I thought I would open the issue to inquire if this was the intended behavior.The text was updated successfully, but these errors were encountered: