Skip to content

Commit

Permalink
fix(resize): adding missing stopPropagation
Browse files Browse the repository at this point in the history
  • Loading branch information
afshinm committed Apr 18, 2021
1 parent 57d887b commit 03034f5
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions packages/gridjs/src/view/plugin/resize/resize.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ export class Resize extends BaseComponent<ResizeProps, ResizeState> {
private mouseMoveFn: (e) => void;
private mouseUpFn: (e) => void;

private mouseDown(e): void {
private click(e: MouseEvent): void {
e.stopPropagation();
}

private mouseDown(e: MouseEvent): void {
e.stopPropagation();

// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// @ts-ignore
const thElement: HTMLElement = this.props.thRef.current;
Expand All @@ -34,7 +40,9 @@ export class Resize extends BaseComponent<ResizeProps, ResizeState> {
document.addEventListener('mousemove', this.mouseMoveFn);
}

private mouseMove(e): void {
private mouseMove(e: MouseEvent): void {
e.stopPropagation();

// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// @ts-ignore
const thElement: HTMLElement = this.props.thRef.current;
Expand All @@ -47,7 +55,9 @@ export class Resize extends BaseComponent<ResizeProps, ResizeState> {
}
}

private mouseUp(): void {
private mouseUp(e: MouseEvent): void {
e.stopPropagation();

document.removeEventListener('mouseup', this.mouseUpFn);
document.removeEventListener('mousemove', this.mouseMoveFn);
}
Expand All @@ -61,7 +71,8 @@ export class Resize extends BaseComponent<ResizeProps, ResizeState> {
className('resizable-right'),
)}
onMouseDown={this.mouseDown.bind(this)}
></div>
onClick={this.click.bind(this)}
/>
);
}
}

0 comments on commit 03034f5

Please sign in to comment.