+ Start a Discussion
Ken Koellner 7Ken Koellner 7 

What to use instead of ui:inputText

<ui:inputText click="{!c.onfocus}" updateOn="keyup" keyup="{!c.keyPressController}" class="slds-lookup__search-input slds-input leftPaddingClass" value="{!v.searchTerm}" placeholder="search..."/>
Support for the ui: tags is supposed to be ending.  What I don't see in the lightning: tags is an equivelent to ui:inputText.  I have the tag above and am wondering what the best thing to replace it with is and if the same options will be available.  I haven't found anything that exactly matches and so I'm researching what to do to get the equivelent functionality.
ANUTEJANUTEJ (Salesforce Developers) 
Hi Ken,

>> https://developer.salesforce.com/docs/component-library/bundle/lightning:input/example#lightningcomponentdemo:exampleInputText

You can use lightning:input you can learn more about this at the above link.

Below sample snippet is the one mentioned in above this is for quick reference:

    <div class="row">
        <h2 class="header">Basic Input Text</h2>
        <lightning:input name="input1" label="Enter some text" />
        <lightning:input name="input2" label="Text field with predefined value" value="initial value"/>
        <lightning:input name="input3" label="Text field with a placeholder" placeholder="type here..."/>

    <div class="row">
        <h2 class="header">Advanced Input Text</h2>
        <lightning:input name="input4" readonly="true" value="initial value" label="Read-only text field with a predefined value" />
        <lightning:input name="input5" disabled="true" value="initial value" label="Disabled text field with a predefined value" />
        <lightning:input name="input6" required="true" value="0123456789" label="Required text field with a maximum length of 10" maxlength="10" />
        <lightning:input name="input7" label="Text field that handles the onfocus and onblur events" onfocus="{! c.handleFocus }" onblur="{! c.handleBlur }" />

    <aura:attribute name="firstName" type="String"/>
    <div class="row">
        <h2 class="header">Live Input Text</h2>
        <lightning:input name="input8" value="{! v.firstName }" placeholder="type your first name..." label="Text field with attribute binding" />
            FirstName: {! v.firstName }

Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.  

Ken Koellner 7Ken Koellner 7
The first thing I looked as for a replacement is lightning:input but I need keystroke handling.  Note the updateOn="keyup" keyup="{!c.keyPressController}" in my example.  I need specifically be able to get the new value and have the controller called on each keystroke.  So to further refine my question, how to I perform that task either with lightning:input or some other tag?  Until that question is answered, I do not have a solution.
ANUTEJANUTEJ (Salesforce Developers) 
In the previous post the link for documentation under specification, you can see that onchange, onblur, oncommit, onfocus these events are present.

>> https://salesforce.stackexchange.com/questions/155635/enter-key-pressed-inside-a-lightning-input

I was able to find a way mentioned in the above link i.e., to use a span tag and inside it they used onkeypressed can you try checking this?

I am adding the snippet in the snippet in above link below for quick reference:
<span onkeypress="{!c.keyCheck}" class="slds-size--11-of-12">
    <lightning:input aura:id="body" label="" name="Body" placeholder="Enter message..." value="{!v.Message.Body__c}" />

keyCheck : function(component, event, helper){
    if (event.which == 13){
        helper.onSend(component, event);

>> Idea Link: https://trailblazer.salesforce.com/ideaView?id=0873A00000159O1QAI

Additionally, there is an open idea that you can upvote so that if it reaches the necessary threshold it may be considered in the future.