How to get old/previous Value which entered in input text field with onchange() event in LWC ? please help
[SalesForce] How to get old/previous Value which entered in input text field with onchange() event in LWC
Related Topic
- [SalesForce] How to add delay in onchange event in LWC
- [SalesForce] Pass input text value to controller on button click in LWC
- [SalesForce] How to get the event Key Id and Value in LWC
- [SalesForce] Get final Lightning input value in LWC JS
- [SalesForce] How to get lookup field display value within the lightning-input-field event
- Sum up input field value inside iterative Table in LWC
Best Answer
The change event spec doesn't account for an old value so you will need to keep track of the value within the component by writing the old or original value to a component property and then referencing it in your change handler. You could also keep an array or a stack of values if you needed a history of what the values were set to.