question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot set property 'scrollTop' of undefined

See original GitHub issue

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

Current behavior Error is thrown when you sort using a column header:


TypeError: Cannot set property 'scrollTop' of undefined
    at Scroller.setOffset (eval at 537 (1.chunk.js:160), <anonymous>:1702:38)
    at eval (eval at 537 (1.chunk.js:160), <anonymous>:1860:28)
    at SafeSubscriber.schedulerFn [as _next] (eval at <anonymous> (vendor.js:87), <anonymous>:6163:58)
    at SafeSubscriber.__tryOrUnsub (eval at <anonymous> (vendor.js:117), <anonymous>:223:16)
    at SafeSubscriber.next (eval at <anonymous> (vendor.js:117), <anonymous>:172:22)
    at Subscriber._next (eval at <anonymous> (vendor.js:117), <anonymous>:125:26)
    at Subscriber.next (eval at <anonymous> (vendor.js:117), <anonymous>:89:18)
    at EventEmitter.Subject.next (eval at <anonymous> (vendor.js:93), <anonymous>:55:25)
    at EventEmitter.emit (eval at <anonymous> (vendor.js:87), <anonymous>:6142:80)
    at StateService.nextSort (eval at 537 (1.chunk.js:160), <anonymous>:914:27)
    at DataTableHeaderCell.onSort (eval at 537 (1.chunk.js:160), <anonymous>:1277:24)
    at DebugAppView._View_DataTableHeaderCell1._handle_click_0_0 (DataTableHeaderCell.ngfactory.js:186)
    at eval (eval at <anonymous> (vendor.js:87), <anonymous>:9678:28)
    at eval (eval at <anonymous> (vendor.js:196), <anonymous>:1813:40)
    at eval (eval at <anonymous> (vendor.js:196), <anonymous>:1926:115)
    at ZoneDelegate.invoke (eval at 572 (polyfills.js:650), <anonymous>:203:28)
    at Object.onInvoke (eval at <anonymous> (vendor.js:87), <anonymous>:6220:41)
    at ZoneDelegate.invoke (eval at 572 (polyfills.js:650), <anonymous>:202:34)
    at Zone.runGuarded (eval at 572 (polyfills.js:650), <anonymous>:110:47)
    at NgZoneImpl.runInnerGuarded (eval at <anonymous> (vendor.js:87), <anonymous>:6249:82)
    at NgZone.runGuarded (eval at <anonymous> (vendor.js:87), <anonymous>:6482:77)
    at HTMLSpanElement.outsideHandler (eval at <anonymous> (vendor.js:196), <anonymous>:1926:83)
    at ZoneDelegate.invokeTask (eval at 572 (polyfills.js:650), <anonymous>:236:37)
    at Zone.runTask (eval at 572 (polyfills.js:650), <anonymous>:136:47)
    at HTMLSpanElement.ZoneTask.invoke (eval at 572 (polyfills.js:650), <anonymous>:304:33)
DebugContext {_view: _View_DataTableHeaderCell1, _nodeIndex: 0, _tplRow: 5, _tplCol: 8}
_nodeIndex
:
0
_staticNodeInfo
:
(...)
_tplCol
:
8
_tplRow
:
5
_view
:
_View_DataTableHeaderCell1
component
:
(...)
componentRenderElement
:
(...)
context
:
(...)
injector
:
(...)
providerTokens
:
(...)
references
:
(...)
renderNode
:
(...)
source
:
(...)
__proto__
:
Object
core.umd.js?e2a5:3427 EXCEPTION: Error in ./DataTableHeaderCell class DataTableHeaderCell - inline template:5:8 caused by: Cannot set property 'scrollTop' of undefined

Sort still operates

Expected behavior

Sort should happen without throwing error.

Reproduction of the problem http://plnkr.co/edit/9Eug63qi775HVCMe3BhO?p=preview

  1. On any tab, click a column header to sort.
  2. See the error thrown in the console. (Error above was copied from local output, not plunker, so line references will be different)

What is the motivation / use case for changing the behavior?

I need sort to run without errors in my app

Please tell us about your environment: Windows VSCode Node Webpack Dev Server

  • Table version: 0.7.x 0.9.2
  • Angular version: 2.0.x @angular/core@2.0.1
  • Browser: Only tried in Chrome
  • Language:

TypeScript@2.0.3

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
amcdnlcommented, Oct 6, 2016

Fixed in 0.9.3

0reactions
amcdnlcommented, Oct 6, 2016

@deeg - Ya thats the right approach.

Read more comments on GitHub >

github_iconTop Results From Across the Web

react Cannot set property 'scrollTop' of undefined
I'm receiving the following error. How can I solve this issue. TypeError: Cannot set property 'scrollTop' of undefined ...
Read more >
Uncaught TypeError: Cannot set property 'scrollTop' of null #31
It seems due to a change in MUI paper doesn't have the role="document" anymore. I fixed it in my app by changing the...
Read more >
Element.scrollTop - Web APIs | MDN
The Element.scrollTop property gets or sets the number of pixels that an element's content is scrolled vertically.
Read more >
解决vue 移动端项目“切换页面,页面置顶”后报错为 ... - 博客园
解决vue 移动端项目“切换页面,页面置顶”后报错为:"TypeError: Cannot set property 'scrollTop' of null". 参考原代码链接:https://www.cnblogs.com/ ...
Read more >
Uncaught TypeError: Cannot read property 'scrollTop' of null
So, in Eureka , this code works fine: function close_and_reopen_UI_Page() { // Close this current pop-up UI page ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found