We have two tabs called X and Y. When we are on Tab Y, we use a checkbox called 'Advanced Filters'.When checked it shows a lightning layout with four inputs.After filling the inputs , if i switch to another tab X and then return back to Tab Y,the layout disappears(rightly so) but the checkbox remains checked.I want to uncheck it too when the tab is switched. This is what i a trying to do.Any response is very much appreciated.
handleTabSwitch(event) {
this.retrievalMode = event.target.value;
this.showBookingFiltersTab = false;
this.showBookingReferenceInput = true;
// this.checkboxVal = false;
let advanceFilterCheckbox =this.template.querySelectorAll('[data-advance-filter = "checkbox"]');
advanceFilterCheckbox.checked = false;
}
When checked it shows the lightning inputs.
When tab is switched to flight and then to Booking, I want to uncheck the checkbox(which is not happening as shown in the screenshot).

querySelectorAllwhich returns a list of checkboxes. You could iterate over the returned list and setchecked=falseor just usequerySelectorif there's only one checkbox.