I need to change a background of a character in the span depending on inputted value. But! I have to check an entry depending on specific order of inputted value. For example, if i have inputted "Inv", i want to change a background only for 3 letters in "Inventory" element, not all "i", "n", "v" entries in the sidebar
This is what I have for now.
backgroundColorSetter(item) {
const spans = item.name.split("").map((char) => (this.inputCharsArray && this.inputCharsArray.includes(char)
? this._spanBackgroundSetter(char)
: this._spanNoBackgroundSetter(char)));
return spans;
}