Pinch to zoom lags in firefox

I’ve noticed that pinch to zoom on my Acer Aspire 5 with the trackpad, pinch to zoom doesn’t appear to be working reliably. Sometimes when I hit the control and spread outwards, zoom out works, other times the screen zooms in and out uncontrollably. But trying to zoom in by pinching doesn’t seem to work at all. I’ve already checked and I am running Wayland on Kde. I also have the same problem on Chromium as well. I don’t have this problem with Windows so I don’t think it’s a hardware issue. What do you think is the problem?