The problem: if you have a Canvas with a scrollbar, then MouseOutHandler is not working as expected.
Environment:
SmartClient Version: v11.1p_2017-09-27/LGPL Development Only (built 2017-09-27)
Chrome Verzió: 60.0.3112.113 (also with other browsers)
Minimal example:
Steps to reproduce with the example above:
If there is a way, please share with me.
Thank you!
Environment:
SmartClient Version: v11.1p_2017-09-27/LGPL Development Only (built 2017-09-27)
Chrome Verzió: 60.0.3112.113 (also with other browsers)
Minimal example:
Code:
public void onModuleLoad() { Canvas parentCanvas = new Canvas(); parentCanvas.setSize("300", "300"); parentCanvas.setBackgroundColor("green"); parentCanvas.addMouseOutHandler(event -> GWT.log("green parent mouseout x: " + event.getX())); Canvas blueCanvas = new Canvas(); blueCanvas.setSize("150", "150"); blueCanvas.setTop(0); blueCanvas.setLeft(150); blueCanvas.setBackgroundColor("blue"); blueCanvas.addMouseOutHandler(event -> GWT.log("blue child mouseout x: " + event.getX())); Canvas yellowCanvas = new Canvas(); yellowCanvas.setSize("150", "150"); yellowCanvas.setOverflow(Overflow.SCROLL); yellowCanvas.setTop(150); yellowCanvas.setLeft(150); yellowCanvas.setBackgroundColor("yellow"); yellowCanvas.addMouseOutHandler(event -> GWT.log("yellow child mouseout x: " + event.getX())); parentCanvas.addChild(blueCanvas); parentCanvas.addChild(yellowCanvas); parentCanvas.draw(); }
- Position the mouse cursor inside the blue area.
- Move the mouse cursor to the right out of the blue area.
- Notice that an onMouseOut event occured both on the parent (green) and the child (blue) with x position greater or equal than 300 which is the width of the parent object:
- 17:10:21.643 blue child mouseout x: 313
- 17:10:21.644 green parent mouseout x: 313
- This is OK so far.
- Now position the mouse cursor inside the yellow area.
- Move the mouse cursor to the right out of the yellow area.
- Notice that an onMouseOut event occured both on the parent (green) and the child (yellow) with x position LOWER than 300, that is, when the cursor was above the scrollbar:
- 17:10:34.111 yellow child mouseout x: 290
- 17:10:34.112 green parent mouseout x: 290
- This is not what I expect.
If there is a way, please share with me.
Thank you!
Comment