Skip to main content
Karthik J (jk) 님이 #LWC Component에 질문했습니다

Hi all

I have written LWC that adds a new row whenever I click on the plus button but the newly added row inherits the value from the previous row. I want to set the values for the newly created rows as optional. Can anyone please help me here?

 

New Row inherits the value of previous row

 

#LWC Component  #LWC Development  #LWC

답변 3개
  1. 2025년 8월 12일 오후 4:07

    Hii,

    If you want to ensure that newly added rows do not inherit values from the previous row, you should make sure that the data structure you use to hold the rows is initialized with completely new values each time(ideally blank here).

    You can use row add approach something like this 

0/9000