Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using activetable within vue and setting tablestyle getting following error #55

Closed
irshadmb opened this issue Aug 23, 2024 · 4 comments

Comments

@irshadmb
Copy link
Contributor

Cannot read properties of null (reading 'offsetWidth')
TypeError: Cannot read properties of null (reading 'offsetWidth')
at ParentResize.shouldRerenderTable (webpack-internal:///./node_modules/active-table/dist/activeTable.js:9872:50)
at ActiveTable.resizeCallback (webpack-internal:///./node_modules/active-table/dist/activeTable.js:9878:18)

@eviltik
Copy link

eviltik commented Aug 23, 2024

duplicate #16

@eviltik
Copy link

eviltik commented Aug 23, 2024

@irshadmb try to make a codepen or a reproducable use case to help devs, ty

@irshadmb
Copy link
Contributor Author

https://codesandbox.io/s/active-table-vue3-forked-2y6qyk?file=/src/App.vue
image

@irshadmb
Copy link
Contributor Author

Function.shouldRerenderTable
/node_modules/active-table/dist/activeTable.js:8599:49
8596 | return ParentResize.doesOverflowNeedRerender(D, O) ? !0 : D._tableDimensions.isPercentage && // resize callback gets triggered on multiple occassions when the parent width has not changed:
8597 | // on startup, after table has been resized, when parent height is changed and when column height is changed
8598 | // this condition prevents the table from re-rendering itself when the above occurs

8599 | D._tableDimensions.recordedParentWidth !== O.offsetWidth && // if the parent is resized to a width that does not impact the table width, do not bother re-rendering it
| ^
8600 | (D._tableDimensions.maxWidth === void 0 || D.offsetWidth > O.offsetWidth);
8601 | }
8602 | static resizeCallback() {
View compiled
ActiveTable.resizeCallback
/node_modules/active-table/dist/activeTable.js:8604:17
8601 | }
8602 | static resizeCallback() {
8603 | const D = this;
8604 | ParentResize.shouldRerenderTable(D) && (D._tableDimensions.preserveNarrowColumns || (D._tableDimensions.preserveNarrowColumns = !0, setTimeout(() => D._tableDimensions.preserveNarrowColumns = !1)), Render.renderTable(D));
| ^
8605 | }
8606 | }
8607 | /**
View compiled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants