Browse Source

Fix error when resizing components in Firefox

pull/6435/head
Artur Arseniev 11 months ago
parent
commit
cb599cd7ca
  1. 4
      packages/core/src/canvas/index.ts

4
packages/core/src/canvas/index.ts

@ -486,7 +486,9 @@ export default class CanvasModule extends Module<CanvasConfig> {
*/
getMouseRelativePos(e: any, opts: any = {}) {
const subWinOffset = opts.subWinOffset;
const doc = e.target.ownerDocument;
const { target } = e;
// In Firefox, pointing outside the window, will return the HTMLDocument.
const doc = target.nodeType === Node.DOCUMENT_NODE ? target : target.ownerDocument;
const win = doc.defaultView || doc.parentWindow;
const frame = win.frameElement;
const yOffset = subWinOffset ? win.pageYOffset : 0;

Loading…
Cancel
Save