Why is there this little lag between (click) and actual fct call & how can i remove it? (video)

Hi,

I am training by making a ruzzle-like. I don’t understand how to remove this little lag.
It is (click) event. My function Touched() does other stuff but it is not coming from that. I tested with an empty test() function and console.log().

Beside, how to make the letters selected on swipe? Because (swipe) is not working.

A little video:
https://sendvid.com/m046dmy6#

My simple code:

<div class="letter" (click)="Touched()" [ngClass]="{'touched': touched }">
{{value}}
</div>

Try adding the ‘tappable’ directive to your div

<div class="letter" tappable (click)="Touched()" [ngClass]="{'touched': touched }">
     {{value}}
</div>

Thanks. I ll try it tonight.

For other who might read this thread, you can find ressource here:

Still having this lag… Any idea ?

Sometime to solve a problem you just need to read the doc. Of ionic, then angular, then mozilla !

Try (tap) in stead of (click).

same issue… I tried other dom event as mouseleave or mouseenter :frowning: same issue. Working perfectly on browser.

Right in the link you posted, it’s said that you should not click it from a div, that that’s exactly what makes the delay to happen. try:

<div class="letter" (click)="Touched()" [ngClass]="{'touched': touched }">
 <a  (click)="Touched()">
  {{value}}
 </a>
</div>

Yes, I tried with tappable, without, with click, mouseenter…doesn’t change anything. Still having a lag.