I have an FAQ page with dropdowns and a text area for filtering results. I am using this package to highlight my words that I search for in the text input. Everything works fine, except the letter "n" weirdly. All special characters, numbers, and other letters seem to work just fine. And if "n" is in any spot in the string EXCEPT the first position it works. When typing "n" or "N" as the very first character in the text search input field, I get this issue:
TypeError: Cannot read properties of null (reading 'substr') at the Highlighter.js component
const text = textToHighlight.substr(chunk.start, chunk.end - chunk.start)
`FAQItems = filterFAQ?.map((faq) => {
let categoryMeta = faq['CategoryMetadata/Category'];
let subCategoryMeta = faq['SubCategoryMetadata/SubCategory'];
I have an FAQ page with dropdowns and a text area for filtering results. I am using this package to highlight my words that I search for in the text input. Everything works fine, except the letter "n" weirdly. All special characters, numbers, and other letters seem to work just fine. And if "n" is in any spot in the string EXCEPT the first position it works. When typing "n" or "N" as the very first character in the text search input field, I get this issue:
TypeError: Cannot read properties of null (reading 'substr') at the Highlighter.js component
const text = textToHighlight.substr(chunk.start, chunk.end - chunk.start)
`FAQItems = filterFAQ?.map((faq) => { let categoryMeta = faq['CategoryMetadata/Category']; let subCategoryMeta = faq['SubCategoryMetadata/SubCategory'];
Then in the child component
}
export default FaqItems;`