1

Following code works perfectly before winter 24 org,

Component:

<aura: component implements="flexipage:availableForRecordHome,force:hasRecordId" access="global" >
    <aura:attribute name="showpassword" type="Boolean" default="false"/>
    <div class="slds-form-element__control slds-input-has-icon slds-input-has-icon--right">
        <lightning:input variant="label-hidden"
                         type="{!v.showpassword ? 'text':'password'}"
                         value="myPasswordText" />
        <lightning:buttonIcon class="slds-button slds-input__icon"
                              iconName="{!v.showpassword ? 'utility:hide':'utility:preview'}"
                              alternativeText="{!v.showpassword ? 'Hide':'Show'}"
                              onclick="{!c.togglePassword}" />
    </div>
</aura: component>

Controller:

({
    // show or hide password
    togglePassword: function (component) {
        const oldValue = component.get('v.showpassword');
        //if true set false/vise-versa
        component.set('v.showpassword', !oldValue);
    },
})

Expected: (Working before WI-24) enter image description here

Issue: (Click on show/hide button you wont see the difference) (After WI-24) enter image description here

1
  • If any salesforce guys see this question kindly raise bug and share us ETA, If you are not going to fix this before prod release let us know, As ISV we need to release new package and manually push changes to customer org.
    – Ragul
    Commented Sep 17, 2023 at 17:40

1 Answer 1

1

You can handle this issue with simple tweak in your code using aura:if

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
    <aura:attribute name="showpassword" type="Boolean" default="false"/>
    <div class="slds-form-element__control slds-input-has-icon slds-input-has-icon--right">
        <aura:if isTrue="{!v.showpassword}">
            <lightning:input variant="label-hidden"
                         type="text"
                         value="myPasswordText" />
            <aura:set attribute="else">
                <lightning:input variant="label-hidden"
                         type="password"
                         value="myPasswordText" />
            </aura:set>
        </aura:if> 
        <lightning:buttonIcon class="slds-button slds-input__icon"
                              iconName="{!v.showpassword ? 'utility:hide':'utility:preview'}"
                              alternativeText="{!v.showpassword ? 'Hide':'Show'}"
                              onclick="{!c.togglePassword}" />
    </div>
</aura:component>

It works perfectly fine in this approach.

enter image description here

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .