We use Debugbear to collect RUM data. And we found that one of tawk.to scripts affects INP score.
Here is a link to this script:
https://embed.tawk.to/_s/v4/app/69e0c09cf0a/js/twk-chunk-common.js
The problem is in this code:
this.initialDocumentClick = function () {
(t.$TawkAudioPlayer.init(), window.removeEventListener("click", t.initialDocumentClick));
}
This code calls t.$TawkAudioPlayer.init() on first “click” event and then removes it from event listener. This init() function could take more than 200ms and it causes INP issue (INP should be less than 200ms).
As a solution for such INP issues, web.dev recommends to use timeout function:
So, this small fix could solve INP issue:
this.initialDocumentClick = function () {
(setTimeout(function () {
t.$TawkAudioPlayer.init()
}, 0), window.removeEventListener("click", t.initialDocumentClick));
}
