I'm trying to add icon inside input and that's fine, but when i try to add some action like onclick it doesn't work. On front when i try to click on the icon i can not do this, cuz input hover it ;/

<div class="slds-form-element__control slds-input-has-icon slds-input-has-icon_right" style="width: -webkit-fill-available;">
                <div class="icon-container" onclick={handleShowHidePassword}>
                    <lightning-icon  size="small" class="front slds-input__icon slds-input__icon_right" icon-name={iconName}></lightning-icon>
                <lightning-input class="login-input slds-m-bottom_medium" type={inputType} label={label.labelPassword} value={password} required data-name="password" onchange={handleInputChange} ></lightning-input>

Ok, i find out the solution

style="pointer-events: painted;"

I added this style to lightning-icon and it's start recognize events

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.