You need to sign in to do that
Don't have an account?
smita bhargava
scroll to component in lighning
I have a code in my lightning component as follows.
what I want is when I type some test and click enter key in lightning:input, inside the method "handleKeyUp" I want to navigate to CompB i.e I want to scrollDown to CompB without the user manually having to do so.
I am struggling with his, please let me know with working code.
thanks
smita B
Comp1.cmp <aura:attribute name="showProviderListcmp" type="Boolean" default="false"/> <lightning:card> <lightning:layout> <lightning:layoutItem flexibility="auto" padding="around-small"> <div onkeyup="{!c.handleKeyUp}"> <lightning:input aura:id="enter-search" name="searchProvider" label="" placeholder = "Search by Name, Speciality, Procedure, Condition or Provider ID " type="search" /> </div> </lightning:layoutItem> </lightning:layout> </lightning:card> <aura:if isTrue="{!v.showSpinner}"> <lightning:spinner aura:id="spinner" variant="brand" size="medium" alternativeText="service Request"/> <aura:set attribute="else"> <aura:if isTrue="{!v.showProviderListcmp}"> <div class="slds-p-bottom_xx-small" id="scrollDiv"></div> <lightning:card title="" aura:id="displayFindCareList"> <c:COMP2/> </lightning:card> </aura:if> </aura:set> </aura:if> Comp1Controller.js handleKeyUp : function (component,event,helper) { var isEnterKey = event.keyCode === 13; if (isEnterKey) { var queryTerm = component.find('enter-search').get('v.value'); if (queryTerm.length > 2) { helper.navigateToList(component,event,helper,queryTerm); }} }, Comp1Helper.js navigateToList : function(component,event,helper,queryTerm){ var flow = component.find("autoServiceRequest"); component.set("v.showSpinner",true); var inputVariables =[ {name: "varCaseRecordId",type:"String",value : component.get("v.caseId")}, {name: "varAutoSrReason",type:"String",value : "Find Provider"}, {name:"varAutoSrSubReason" ,type:"String",value:queryTerm} ]; flow.startFlow("GPS_Create_Auto_Service_Request",inputVariables); component.set("v.showProviderListcmp",true); },
what I want is when I type some test and click enter key in lightning:input, inside the method "handleKeyUp" I want to navigate to CompB i.e I want to scrollDown to CompB without the user manually having to do so.
I am struggling with his, please let me know with working code.
thanks
smita B