Skip to content

Commit

Permalink
fix: eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoiver committed May 23, 2022
1 parent b2470ae commit c584ff7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/g-plugin-dom-interaction/src/DOMInteractionPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { InteractivePointerEvent, RenderingPlugin, RenderingService } from
import { ContextService, RenderingContext, RenderingPluginContribution } from '@antv/g';
import { inject, singleton } from 'mana-syringe';

const MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
// const MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;

/**
* listen to mouse/touch/pointer events on DOM wrapper, trigger pointer events
Expand All @@ -19,7 +19,7 @@ export class DOMInteractionPlugin implements RenderingPlugin {

apply(renderingService: RenderingService) {
const canvas = this.renderingContext.root.ownerDocument.defaultView;
const SUPPORT_ONLY_TOUCH = canvas.supportsTouchEvents && MOBILE_REGEX.test(navigator.userAgent);
// const SUPPORT_ONLY_TOUCH = canvas.supportsTouchEvents && MOBILE_REGEX.test(navigator.userAgent);

const onPointerMove = (ev: InteractivePointerEvent) => {
renderingService.hooks.pointerMove.call(ev);
Expand Down
8 changes: 4 additions & 4 deletions packages/g-plugin-dragndrop/src/DragndropPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export class DragndropPlugin implements RenderingPlugin {
event.type = 'dragstart';
target.dispatchEvent(event);

let shiftX = event.clientX - target.getBoundingClientRect().left;
let shiftY = event.clientY - target.getBoundingClientRect().top;
const shiftX = event.clientX - target.getBoundingClientRect().left;
const shiftY = event.clientY - target.getBoundingClientRect().top;

moveAt(event.canvasX, event.canvasY);

Expand All @@ -57,12 +57,12 @@ export class DragndropPlugin implements RenderingPlugin {

const point =
overlap === 'pointer' ? [event.canvasX, event.canvasY] : target.getBounds().center;
let elemBelow = await document.elementFromPoint(point[0], point[1]);
const elemBelow = await document.elementFromPoint(point[0], point[1]);
target.style.pointerEvents = pointerEventsOldValue;

if (!elemBelow) return;

let droppableBelow = elemBelow.closest('[droppable=true]');
const droppableBelow = elemBelow.closest('[droppable=true]');
if (currentDroppable !== droppableBelow) {
if (currentDroppable) {
// null when we were not over a droppable before this event
Expand Down
4 changes: 2 additions & 2 deletions packages/g/src/dom/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,8 @@ export interface IDocument extends INode, IParentNode {
options: DisplayObjectConfig<StyleProps>,
) => T;

elementFromPoint(x: number, y: number): Promise<DisplayObject>;
elementsFromPoint(x: number, y: number): Promise<DisplayObject[]>;
elementFromPoint: (x: number, y: number) => Promise<DisplayObject>;
elementsFromPoint: (x: number, y: number) => Promise<DisplayObject[]>;
}

/**
Expand Down

0 comments on commit c584ff7

Please sign in to comment.