function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Maulik Patel 38Maulik Patel 38 

Data entered in input field not caching in conditional rendering in LWC

Hi,

I have a requirement where I am using conditonal rendering in the LWC. 
I have 3 child components and I am using record-edit form for inserting the data in the child components whose visiblity is maintained in parent component.
The way it works is l have next button and previous button so when I fill the details in the initial component which is having account input fields and click on next  the conditional rendering shows the second component which is contact input field and hides the first one and it has two buttons next and previous.
Now when I click on previous the data that i entered earlier is not showing and it is just showing the blank input fields in the Account input fields so the data that i entered earlier is reset.
Is there a way where when i click on previous it cache or stores the data that i entered earlier in the input fields?  

I was not able to copy the whole code here but I used the code form the GitHub repo link.
https://github.com/ShreyasD/lwc-customaccountwizard

The only change I made was in the contactDetails.js for handlePrevious(event) as below 
handlePrevious(event) {
        event.preventDefault(); //stop default action
        //Send event to parent to go to next page
        this.dispatchEvent(new CustomEvent('previous'));
    }


Parent Component -: customAccountWizard
Child Component =: accountDetails,contactDetails and customAccountWizardReview.


Thank you !