You need to sign in to do that
Don't have an account?
meghna n
scroll to component during onchange event
I have a piece of code inside my lightning component as follows
CompA.cmp
<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:layoutItem flexibility="auto" padding="around-small">
<lightning:card title="" aura:id="showhide">
<cCompB/>
</lightning:card>
<aura:if some condition
then display <c:CompC/>
<./aura:component>
CompAController.js
handleKeyUp: function (component,event,helper) {
var isEnterKey = event.keyCode === 13;
if (isEnterKey) {
var queryTerm = component.find('enter-search').get('v.value');
} }
when I enter some text in above component then it should scroll down automatically to compC
The issue I am facing is it is not scrolling to compC I have to manually scroll from the side bar to compC.
Please tell me how to do this> I find it difficult to handle.
thanks
meghna N
CompA.cmp
<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:layoutItem flexibility="auto" padding="around-small">
<lightning:card title="" aura:id="showhide">
<cCompB/>
</lightning:card>
<aura:if some condition
then display <c:CompC/>
<./aura:component>
CompAController.js
handleKeyUp: function (component,event,helper) {
var isEnterKey = event.keyCode === 13;
if (isEnterKey) {
var queryTerm = component.find('enter-search').get('v.value');
} }
when I enter some text in above component then it should scroll down automatically to compC
The issue I am facing is it is not scrolling to compC I have to manually scroll from the side bar to compC.
Please tell me how to do this> I find it difficult to handle.
thanks
meghna N
Try below code, it works for me Controller:
I hope you find the above solution helpful. If it does mark as best answer to help others too.
Thanks,
Ramesh D
All Answers
Try below code, it works for me Controller:
I hope you find the above solution helpful. If it does mark as best answer to help others too.
Thanks,
Ramesh D
I have given an exact piece of code in my component as follows
If u observe the code when we press the enter key in lightning:input , the application will execute a spinner and then call the visual flow.
so in my case after the spinner and before the visual flow is called I need to scroll down to the component GPS_COMP_FindCareList.
Also after the spiiner is called I have kept an div tage if u observe in my code.
I tried ur code in the controller but it is showing error in the statement yeldiv.style.display = "block";
Can u please advise with a correct(workable) solution?
thanks
meghna