[SalesForce] Get final Lightning input value in LWC JS

I have a lightning-input tag in my LWC HTML file and i want to get the final value of the text which user inputs. I have a onchange event but it gives me value on every change.
for eg. if the user inputs good. It gives me values as g,go,goo,good.
I want the last value i.e. good.

<lightning-input type="text" required label="Please provide details" placeholder="Add your comments" onchange={handleTextChange} name={question.questionApiName} value={textValue}></lightning-input>

Best Answer

For a lookup inputs, generally its recommended to add a timeout to avoid any unnecessary Apex calls.


If you want to get the final value after the change, use the onblur event .

The blur event fires when an element has lost focus.

Here is a playground link.