function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Maguy FogaingMaguy Fogaing 

Hello Everyone. Does anyone knows how to avoid copy paste of password and email using ara:component and ui:inputText ? and at the same time how to add tooltip pour symbol information(i) ?

Hello Everyone. Does anyone knows how to avoid copy paste of password and email using ara:component and ui:inputText ? and at the same time how to add tooltip pour symbol information(i) ?   
Best Answer chosen by Maguy Fogaing
bhanu prakash 350bhanu prakash 350
The below controller for above component will work fine. I alredy tried this


({
	handlePaste: function(component, event, helper) {
    event.preventDefault(); 
        helper.toggleHelper(component, event);
}


helper:


toggleHelper : function(component,event) {
    var toggleText = component.find("tooltip");
    $A.util.toggleClass(toggleText, "toggle");
   }

css:

.THIS.toggle {
   display: none;
 }

make this answer as best if it solve your requirement.

All Answers

bhanu prakash 350bhanu prakash 350
hi Maguy Fogaing,
You can use the below code 

 
<div class="slds-form-element">
   <div class="slds-form-element__icon slds-align-middle" onpaste="{! c.handlePaste }" >
      <button class="slds-button slds-button slds-button--icon"  aria-describedby="help" title="Help">
          <ui:inputText value="{!v.password}" />
         <span class="slds-assistive-text">Help</span>
      </button>
   </div>
</div>
<div class="slds-popover slds-popover--tooltip slds-nubbin--left-top toggle" role="tooltip" id="help" style="position:absolute;top:4px;left:180px;" aura:id="tooltip">
   <div class="slds-popover__body">You need to enter manually.</div>
</div>

 
Maguy FogaingMaguy Fogaing
Thank you for your response,
the inputtext still allow the paste functionality. and l don't want that. and the tooltip don't appear and disappear when l click in the inputText.
please help me l don't know how to do it.
bhanu prakash 350bhanu prakash 350
The below controller for above component will work fine. I alredy tried this


({
	handlePaste: function(component, event, helper) {
    event.preventDefault(); 
        helper.toggleHelper(component, event);
}


helper:


toggleHelper : function(component,event) {
    var toggleText = component.find("tooltip");
    $A.util.toggleClass(toggleText, "toggle");
   }

css:

.THIS.toggle {
   display: none;
 }

make this answer as best if it solve your requirement.
This was selected as the best answer
Maguy FogaingMaguy Fogaing
l do't know what is wrong finally l got this message

Unknown Exception
10:08:25.530 Starting SFDX: Deploy Source to Org

when l remoe your code in my project it's still doesn't work. Did you have the same issue ? if yes how did you fix it ?
Maguy FogaingMaguy Fogaing
Hello bhanu prakash 350, 

l am so HAPPYYYY you said right. it works fine also with me.
I will mark your answer as the best because it is !!!!
Thank You very much !!!!! 
 
Maguy FogaingMaguy Fogaing
Please l just note something about the tooltips how can l make it appear and dissappear when l click on a symbol like i for exemple or when l click in the inputText.

I am waiting for your answer or any help.
bhanu prakash 350bhanu prakash 350
In the above code  make a change.

<div class="slds-form-element__icon slds-align-middle" onpaste="{! c.handlePaste }" >  Replace this statement with below statement

<div class="slds-form-element__icon slds-align-middle" onclick="{! c.handlePaste }" >