Strange behaviour Onchange event which got fired on initial load .I need to hide the button on initial load. How to overcome this behaviour. Attaching here part of code. Thanks in advance.
Updated info: I could able to figure about where it is calling. Onchange event is called during onload only for picklist list field. Once I remove onChange event only on picklist. I am having expected behaviour. There is an article about it. help.salesforce.com/… .. However I need to have an Onchange event for picklist. The referred article suggest to validate onload if the value is changed from UI. Do you have idea of how we can achieve this?
<td> <div class="slds-form-element"> <div class="slds-form-element__label" > <label for="horizontal-output-id-01">Status</label> </div> <div class="slds-form-element__control"> <lightning-input-field id="fid2" field- name="Status__c" variant="label-hidden" style="width:50%" onchange={HandleInlineEdit}> </lightning-input-field> </div> </div> </td> <div if:true ={isEditable} class="slds-align_absolute-center" style="padding:5px;"> <button class="slds-button slds-button_brand" name="ClickSave" type='submit'>Save</button> <button class="slds-button slds-button_neutral" onclick= {canceledit}>Cancel</button> </div> @track isEdit=false; //Init connectedCallback(){ this.isEdit=false; console.log('editt' , this.isEdit); this.ExpSecClass = 'slds-section slds-is-open'; } HandleInlineEdit(evt){ console.log('hANDLEedit' , this.isEdit ); this.isEdit=true; } get isEditable() { console.log('edit' , this.isEdit ); return this.isEdit ;}
ClickSaveandCancelbuttons on init?