How to catch Zoom event using GWT and Chrome

I saw a lot of talk about how to get the current zoom ratio in the browser, but I did not understand why this snippet works in Firefox and not in Chrome.

public class MyComposite extends Composite { public MyComposite() { HTMLPanel panel = new HTMLPanel("<applet>...</applet>"); panel.addDomHandler(new MouseWheelHandler() { @Override public void onMouseWheel(MouseWheelEvent event) { event.stopPropagation(); event.preventDefault(); } }, MouseWheelEvent.getType()); initWidget(panel); } } 

In both browsers, when I scroll inside the div containing the applet, the scroll does not extend to the parent (this is normal). And when I go beyond the div, the window scrolls (which is also good).

But when I do Ctrl + MouseWheel, in Firefox the zoom event is captured by the handler and not propagated, while in Chrome the handler does not seem to be called, and the event then propagates. I would also like to stop the distribution in Chrome.

Is there a bug in Chrome or am I something wrong?

0
source share
1 answer

Late heads-up: this seems to be a bug in Chrome. I submitted a report a couple of years ago, but it seems that this is not a priority for them. If you stumble upon this entry, and you also want this "feature", leave a message in this report, perhaps this will speed things up ...

0
source

All Articles