Highlight text from Autocomplete (Make Characters Bold as we Type)

Highlight text from Autocomplete (Make Characters Bold as we Type)

Unable to Add Bold in span from Code Behind

Inline is working :
const highlight = value => <b>${value}</b>;

But Not Funtion

const highlight = value => {
const spanSuggestionWrapper = document.createElement(‘span’);
spanSuggestionWrapper.className = select.Testing;
spanSuggestionWrapper.innerText = value;
return spanSuggestionWrapper;
};

Please see the Screenshot for better Understanding of the Problem statement.

Can this not be solved by using CSS to give font-weight: bold to the autoComplete_result class?

No Because autoComplete_result will make Bold of entire Row,

But I need to make Only the character Bold which are typed in inputbox.Work1

Oh okay, I see what you’re saying now.

From your screenshots, your solution is to return spanSuggestionWrapper.outerHTML; instead of returning the SpanElement object.

1 Like

Perfect, Exactly what I was looking for, Its working Fine.

Let me know how to mark as answer to your post.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.