ngx-datatable icon indicating copy to clipboard operation
ngx-datatable copied to clipboard

Long Press bug

Open tmburnell opened this issue 2 years ago • 0 comments

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter

Current behavior If a navigation / destroy happens in less than half a second after a user long presses on a column header you get this error: Cannot read properties of undefined (reading 'add')

Expected behavior

Just should not error

Reproduction of the problem

looking at this: long-press.directive.ts A ngDestroy sets subscription to undefined.

However if an user mouse downs on a column header less than 500ms before the destroy. the below code will execute and error because subscription is undefined.

      this.subscription.add(
        fromEvent(document, 'mousemove')
          .pipe(takeUntil(mouseup))
          .subscribe((mouseEvent: MouseEvent) => this.onMouseMove(mouseEvent))
      );
  • Table version: any

  • Angular version: any

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ] any

  • Language: [all | TypeScript X.X | ES6/7 | ES5] any

tmburnell avatar Jun 01 '22 17:06 tmburnell