Consider marking touch and wheel event listeners as `passive` to improve scroll performance

Hi,

A year ago I opened a support topic about the same issue. It seemed to me that it was well recieved by @alexander but I have the impression that making touch and wheel event listeners as passive has been delayed in your pipeline.

Would you be so kind as to shed some light on your plans regarding this matter?

Thanks.

Regards

Hi Abarka,

Thanks for reaching out.

It’s partially implemented with the current release version, it’s also applied to scroll box and other components used in the builder and theme. But adding passive to all event is not possible especially the elements and events that needs event bubble, and that passive flag prevent it from working.

And with passive setup, the preventDefault() also fails, that’s because the browser will halt execution where preventDefault() is not applicable and throwing warning and error. Please check this https://wanago.io/2018/07/02/understanding-events-bubbling-and-capturing/ as well, it’s related to the errors we’re getting.

This been investigated since last December and there were issues on touch devices. Hence, for now, passive is partially implemented. Based on my understanding, passive is only good for events with a specific purpose, like custom added codes. For events that being used by a majority of elements, it will mostly fail. But we’re still into it.

Thanks!

1 Like

HI @rad,

I appreciate your thoughtful explanation. I am glad to know there have been improvements and that you are still working into it despite the limitations.

Thanks!

You’re most welcome Abarka.

Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.